public void ExceptionCantBeNull() { Assert.ThrowsException <ArgumentException>(() => { var rollbarException = new dto.Exception((System.Exception)null); }); }
public void ExceptionFromClassNameCanHaveDescription() { var rollbarException = new dto.Exception("NotFiniteNumberException") { Description = "Hello World!", }; Assert.AreEqual("Hello World!", rollbarException.Description); }
public void ExceptionFromClassNameCanHaveMesasge() { var rollbarException = new dto.Exception("NotFiniteNumberException") { Message = "Hello World!", }; Assert.AreEqual("Hello World!", rollbarException.Message); }
public void ExceptionFromExceptionCanHaveDescription() { var rollbarException = new dto.Exception(GetException()) { Description = "Hello World!", }; Assert.AreEqual("Hello World!", rollbarException.Description); }
public void ExceptionFromExceptionCanHaveMessage() { var rollbarException = new dto.Exception(GetException()) { Message = "Hello World!", }; Assert.AreEqual("Hello World!", rollbarException.Message); }
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\"")); }
public void ExceptionSerializesCorrectly() { var rollbarException = new dto.Exception("Test"); Assert.AreEqual("{\"class\":\"Test\"}", JsonConvert.SerializeObject(rollbarException)); }
public void ExceptionFromClassNameHasClass() { var rollbarException = new dto.Exception("NotFiniteNumberException"); Assert.AreEqual("NotFiniteNumberException", rollbarException.Class); }
public void ExceptionFromExceptionHasClass() { var rollbarException = new dto.Exception(GetException()); Assert.AreEqual("System.NotFiniteNumberException", rollbarException.Class); }