Ejemplo n.º 1
0
        public void sad_path_permanent_wrong_value()
        {
            var assertion = new RedirectAssertion("/to", false);

            AssertionRunner
            .Run(assertion, x => x.Response.As <StubHttpResponse>().Redirect("/to", true))
            .SingleMessageShouldBe("Expected permanent redirect to be 'False' but it was not.");
        }
Ejemplo n.º 2
0
        public void sad_path_wrong_value()
        {
            var assertion = new RedirectAssertion("/to", false);

            AssertionRunner
            .Run(assertion, x => x.Response.As <StubHttpResponse>().Redirect("/wrong"))
            .SingleMessageShouldBe("Expected to be redirected to '/to' but was '/wrong'.");
        }
Ejemplo n.º 3
0
        public void happy_path_permanent()
        {
            var assertion = new RedirectAssertion("/to", true);

            AssertionRunner
            .Run(assertion, x => x.Response.As <StubHttpResponse>().Redirect("/to", true))
            .AssertAll();
        }
Ejemplo n.º 4
0
        public void sad_path_no_value()
        {
            var assertion = new RedirectAssertion("/to", false);

            AssertionRunner
            .Run(assertion, x => { })
            .SingleMessageShouldBe("Expected to be redirected to '/to' but was ''.");
        }