public void ErrorAndMessageConstructorWorks() { var err = new Error { Message = "Some message" }; var ex = new JsErrorException(err, "Overridden message"); Assert.IsTrue((object)ex is JsErrorException, "is JsErrorException"); Assert.IsTrue(ex.InnerException == null, "InnerException"); Assert.IsTrue(ReferenceEquals(ex.Error, err), "Error"); Assert.AreEqual(ex.Message, "Overridden message", "Message"); }
public void TypePropertiesAreCorrect() { Assert.AreEqual(typeof(JsErrorException).FullName, "ss.JsErrorException", "Name"); Assert.IsTrue(typeof(JsErrorException).IsClass, "IsClass"); Assert.AreEqual(typeof(JsErrorException).BaseType, typeof(Exception), "BaseType"); object d = new JsErrorException(new Error()); Assert.IsTrue(d is JsErrorException, "is InvalidOperationException"); Assert.IsTrue(d is Exception, "is Exception"); var interfaces = typeof(JsErrorException).GetInterfaces(); Assert.AreEqual(interfaces.Length, 0, "Interfaces length"); }