public void happy_path() { var assertion = new HeaderValueAssertion("foo", "bar"); AssertionRunner.Run(assertion, x => x.Response.Headers["foo"] = "bar") .AssertAll(); }
public void sad_path_wrong_value() { var assertion = new HeaderValueAssertion("foo", "bar"); AssertionRunner.Run(assertion, x => x.Response.Headers["foo"] = "baz") .SingleMessageShouldBe("Expected a single header value of 'foo'='bar', but the actual value was 'baz'"); }
public void sad_path_no_values() { var assertion = new HeaderValueAssertion("foo", "bar"); AssertionRunner.Run(assertion, e => {}) .SingleMessageShouldBe("Expected a single header value of 'foo'='bar', but no values were found on the response"); }
public void sad_path_too_many_values() { var assertion = new HeaderValueAssertion("foo", "bar"); AssertionRunner.Run(assertion, x => { x.Response.Headers.Append("foo", "baz"); x.Response.Headers.Append("foo", "bar"); }) .SingleMessageShouldBe("Expected a single header value of 'foo'='bar', but the actual values were 'baz', 'bar'"); }