예제 #1
0
        public void TestSerializeRequest_RequestUriIsNull_ShouldThrowArgumentNullException()
        {
            HttpRequestMessage request = new HttpRequestMessage();

            request.Method  = HttpMethod.Post;
            request.Content = new ByteArrayContent(Encoding.UTF8.GetBytes("test"));
            request.Content.Headers.TryAddWithoutValidation("content-type", "application/json");

            TestAssert.Throws <ArgumentNullException>(() => new HttpRequestResponseSerializer().SerializeRequest(request));
        }
예제 #2
0
        public void ConvertDeliveryAckTypeToString_InvalidValue_Fail()
        {
            Action action = () => Utils.ConvertDeliveryAckTypeToString((DeliveryAcknowledgement)100500);

            TestAssert.Throws <NotSupportedException>(action);
        }
예제 #3
0
        public void ConvertDeliveryAckTypeFromString_InvalidString_Fail()
        {
            Action action = () => Utils.ConvertDeliveryAckTypeFromString("unknown");

            TestAssert.Throws <NotSupportedException>(action);
        }
 public void TestParseCertificates_EmptyCertificates_ShouldThrow()
 {
     TestAssert.Throws <InvalidOperationException>(() => new TrustBundleProvider().ParseCertificates(string.Empty));
 }
 public void TestParseCertificates_NullCertificates_ShouldThrow()
 {
     TestAssert.Throws <InvalidOperationException>(() => new TrustBundleProvider().ParseCertificates(null));
 }
 public void TestParseCertificates_InvalidCertificates_ShouldThrow()
 {
     TestAssert.Throws <CryptographicException>(() => new TrustBundleProvider().ParseCertificates(certificateStringInvalid));
 }
예제 #7
0
 public void TestSerializeRequest_RequestIsNull_ShouldThrowArgumentNullException()
 {
     TestAssert.Throws <ArgumentNullException>(() => new HttpRequestResponseSerializer().SerializeRequest(null));
 }