Beispiel #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));
        }
        public void ConvertDeliveryAckTypeToString_InvalidValue_Fail()
        {
            Action action = () => Utils.ConvertDeliveryAckTypeToString((DeliveryAcknowledgement)100500);

            TestAssert.Throws <NotSupportedException>(action);
        }
        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));
 }
Beispiel #7
0
 public void TestSerializeRequest_RequestIsNull_ShouldThrowArgumentNullException()
 {
     TestAssert.Throws <ArgumentNullException>(() => new HttpRequestResponseSerializer().SerializeRequest(null));
 }