コード例 #1
0
        public void SetMessageInConstructor()
        {
            // get new instance
            var instance = new CannotRemoveException(TestMessage);

            // asserts whether the test exception//s message is equal to the test message
            Assert.AreEqual(TestMessage, instance.Message);
        }
コード例 #2
0
        public void CreateNewCannotRemoveException()
        {
            // create a new instance
            var exception = new CannotRemoveException(TestMessage);

            // test that it//s been instantiated
            Assert.IsNotNull(exception);

            // asserts whether the test exception//s message is equal to the test message
            Assert.AreEqual(TestMessage, exception.Message);
        }