예제 #1
0
 public void ExceptionCantBeNull()
 {
     Assert.ThrowsException <ArgumentException>(() =>
     {
         var rollbarException = new dto.Exception((System.Exception)null);
     });
 }
예제 #2
0
        public void ExceptionFromClassNameCanHaveDescription()
        {
            var rollbarException = new dto.Exception("NotFiniteNumberException")
            {
                Description = "Hello World!",
            };

            Assert.AreEqual("Hello World!", rollbarException.Description);
        }
예제 #3
0
        public void ExceptionFromClassNameCanHaveMesasge()
        {
            var rollbarException = new dto.Exception("NotFiniteNumberException")
            {
                Message = "Hello World!",
            };

            Assert.AreEqual("Hello World!", rollbarException.Message);
        }
예제 #4
0
        public void ExceptionFromExceptionCanHaveDescription()
        {
            var rollbarException = new dto.Exception(GetException())
            {
                Description = "Hello World!",
            };

            Assert.AreEqual("Hello World!", rollbarException.Description);
        }
예제 #5
0
        public void ExceptionFromExceptionCanHaveMessage()
        {
            var rollbarException = new dto.Exception(GetException())
            {
                Message = "Hello World!",
            };

            Assert.AreEqual("Hello World!", rollbarException.Message);
        }
예제 #6
0
        public void ExceptoinSerializesMessageCorrectly()
        {
            var rollbarException = new dto.Exception("Test")
            {
                Message = "Oops!"
            };

            Assert.IsTrue(JsonConvert.SerializeObject(rollbarException).Contains("\"message\":\"Oops!\""));
            Assert.IsTrue(JsonConvert.SerializeObject(rollbarException).Contains("\"class\":\"Test\""));
        }
예제 #7
0
        public void ExceptionSerializesCorrectly()
        {
            var rollbarException = new dto.Exception("Test");

            Assert.AreEqual("{\"class\":\"Test\"}", JsonConvert.SerializeObject(rollbarException));
        }
예제 #8
0
        public void ExceptionFromClassNameHasClass()
        {
            var rollbarException = new dto.Exception("NotFiniteNumberException");

            Assert.AreEqual("NotFiniteNumberException", rollbarException.Class);
        }
예제 #9
0
        public void ExceptionFromExceptionHasClass()
        {
            var rollbarException = new dto.Exception(GetException());

            Assert.AreEqual("System.NotFiniteNumberException", rollbarException.Class);
        }