Esempio n. 1
0
 /// <summary>
 /// Assert that the Http response body text is exactly the expected content
 /// </summary>
 /// <param name="scenario"></param>
 /// <param name="exactContent"></param>
 /// <returns></returns>
 public static Scenario ContentShouldBe(this Scenario scenario, string exactContent)
 {
     return(scenario.AssertThat(new BodyTextAssertion(exactContent)));
 }
Esempio n. 2
0
        // ENDSAMPLE

        /// <summary>
        /// Assert that the Http response does not contain the designated text
        /// </summary>
        /// <param name="scenario"></param>
        /// <param name="text"></param>
        /// <returns></returns>
        public static Scenario ContentShouldNotContain(this Scenario scenario, string text)
        {
            return(scenario.AssertThat(new BodyDoesNotContainAssertion(text)));
        }
 /// <summary>
 /// Assert that the http response was redirected permanently
 /// </summary>
 /// <param name="scenario"></param>
 /// <param name="expected"></param>
 /// <returns></returns>
 public static Scenario RedirectPermanentShouldBe(this Scenario scenario, string expected)
 {
     scenario.AssertThat(new RedirectAssertion(expected, true));
     return(scenario);
 }
Esempio n. 4
0
 /// <summary>
 /// Asserts that there is a single header value matching 'expected'
 /// in the Http response
 /// </summary>
 /// <param name="expected"></param>
 /// <returns></returns>
 public HeaderExpectations SingleValueShouldEqual(string expected)
 {
     _parent.AssertThat(new HeaderValueAssertion(_headerKey, expected));
     return(this);
 }
Esempio n. 5
0
 /// <summary>
 /// Assert that the http response was redirected
 /// </summary>
 /// <param name="scenario"></param>
 /// <param name="expected"></param>
 /// <returns></returns>
 public static Scenario RedirectShouldBe(this Scenario scenario, string expected)
 {
     scenario.StatusCodeShouldBe(302);
     scenario.AssertThat(new RedirectAssertion(expected, false));
     return(scenario);
 }