public void GetBody_WithNullEncoding_ThrowsException() { var response = new BasicHttpResponse(); response.AppendToBody("ABCD"); Assert.That( () => response.GetBodyAsString(null), Throws.Exception.TypeOf <ArgumentNullException>().With.Property("ParamName").EqualTo("encoding")); }
public void AppendToBody_WithAdditionalString_AppendsToEnd() { var newString = "ABCDE"; var expectedString = "ABCDEABCDE"; var response = new BasicHttpResponse(); response.AppendToBody(newString); response.AppendToBody(newString); Assert.AreEqual(10, response.BodyLength); CollectionAssert.AreEqual(expectedString, response.GetBodyAsString()); }
public void GetBody_WithNullEncoding_ThrowsException() { var response = new BasicHttpResponse(); response.AppendToBody("ABCD"); Assert.That( () => response.GetBodyAsString(null), Throws.Exception.TypeOf<ArgumentNullException>().With.Property("ParamName").EqualTo("encoding")); }