Headless.UnitTests.BrowserExtensionsTests.PostToStaticNavigatesToPageLocationTest C# (CSharp) Method

PostToStaticNavigatesToPageLocationTest() private method

private PostToStaticNavigatesToPageLocationTest ( ) : void
return void
        public void PostToStaticNavigatesToPageLocationTest()
        {
            IList<PostEntry> parameters = new List<PostEntry>
            {
                new PostEntry("test", "value")
            };
            var expected = new TextPageWrapper();

            var target = Substitute.For<IBrowser>();

            target.Execute<TextPageWrapper>(
                Arg.Is<HttpRequestMessage>(x => x.RequestUri == expected.TargetLocation && x.Method == HttpMethod.Post),
                HttpStatusCode.OK,
                Arg.Any<IPageFactory>()).Returns(expected);

            var actual = target.PostTo<TextPageWrapper>(parameters);

            actual.Should().BeSameAs(expected);
        }