/// <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))); }
// 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); }
/// <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); }
/// <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); }