public void Canceled() { CheckoutException ex = CheckoutException.Canceled; Assert.AreEqual(-2147467260, ex.ErrorCode, "#1"); Assert.IsNull(ex.InnerException, "#2"); Assert.IsNotNull(ex.Message, "#3"); Assert.IsTrue(ex.Message.IndexOf(ex.GetType().FullName) == -1, "#4"); }
[Test] // ctor () public void Constructor0() { CheckoutException ex = new CheckoutException(); Assert.AreEqual(-2147467259, ex.ErrorCode, "#1"); Assert.IsNull(ex.InnerException, "#2"); Assert.IsNotNull(ex.Message, "#3"); Assert.IsTrue(ex.Message.IndexOf(ex.GetType().FullName) == -1, "#4"); Assert.AreEqual(new ExternalException().Message, ex.Message, "#5"); }
[Test] // ctor (string) public void Constructor1() { CheckoutException ex; string msg = "ERROR"; ex = new CheckoutException(msg); Assert.AreEqual(-2147467259, ex.ErrorCode, "#A1"); Assert.IsNull(ex.InnerException, "#A2"); Assert.AreSame(msg, ex.Message, "#A3"); ex = new CheckoutException((string)null); Assert.AreEqual(-2147467259, ex.ErrorCode, "#B1"); Assert.IsNull(ex.InnerException, "#B2"); Assert.IsNotNull(msg, ex.Message, "#B3"); Assert.IsTrue(ex.Message.IndexOf(ex.GetType().FullName) != -1, "#B4"); ex = new CheckoutException(string.Empty); Assert.AreEqual(-2147467259, ex.ErrorCode, "#C1"); Assert.IsNull(ex.InnerException, "#C2"); Assert.IsNotNull(msg, ex.Message, "#C3"); Assert.AreEqual(string.Empty, ex.Message, "#C4"); }