Exemplo n.º 1
0
        public void WithNullString_ThrowsArgumentNullException()
        {
            if (Runtime.OS != Swan.OperatingSystem.Windows)
            {
                Assert.Ignore("Ignored");
            }

            Assert.Throws <ArgumentNullException>(() => NullString.ToSafeFilename());
        }
Exemplo n.º 2
0
 public void WithNullString_ThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => NullString.RemoveControlCharsExcept(null));
 }
        public JsonHttpResponseValidation(HttpTextResponse response)
        {
            if (response == null)
            {
                throw AssertionExceptionFactory.Create("Expected response to be an instance, but got NULL.");
            }

            const string expectedContentType = "application/json";

            if (response.ContentType != expectedContentType)
            {
                throw AssertionExceptionFactory.CreateForResponse(response, "Expected response content type to be '{0}', but got '{1}'.", expectedContentType, NullString.IfNull(response.ContentType));
            }

            Response = response;
        }
Exemplo n.º 4
0
 public void WithNullHex_ThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           NullString.ConvertHexadecimalToBytes());
 }