public void Create_Instance_With_Type()
 {
     var exception = new ServiceBusMessageException(typeof(string));
     Assert.Equal(exception.MessageType, typeof(string));
     Assert.Equal(exception.Message, "Could not send messageType 'System.String'");
     Assert.Throws<ServiceBusMessageException>(() => { throw exception; });
 }
Beispiel #2
0
        public void Create_Instance_With_Type()
        {
            var exception = new ServiceBusMessageException(typeof(string));

            Assert.AreEqual(exception.MessageType, typeof(string));
            Assert.AreEqual(exception.Message, "Could not send messageType 'System.String'");
            throw exception;
        }
 public void Create_Instance_With_Type_And_InnerException()
 {
     var operationException = new InvalidOperationException();
     var exception = new ServiceBusMessageException(typeof(string), operationException);
     Assert.Equal(exception.MessageType, typeof(string));
     Assert.Equal(exception.InnerException, operationException);
     Assert.Equal(exception.Message, "Could not send messageType 'System.String'");
     Assert.Throws<ServiceBusMessageException>(() => { throw exception; });
 }
Beispiel #4
0
        public void Create_Instance_With_Type_And_InnerException()
        {
            var operationException = new InvalidOperationException();
            var exception          = new ServiceBusMessageException(typeof(string), operationException);

            Assert.AreEqual(exception.MessageType, typeof(string));
            Assert.AreEqual(exception.InnerException, operationException);
            Assert.AreEqual(exception.Message, "Could not send messageType 'System.String'");
            throw exception;
        }