Inheritance: System.Exception
コード例 #1
0
        public void Should_have_constructor_with_error_message()
        {
            var expectedMessage = "Message";

            var target = new ValidationException(expectedMessage);

            Assert.That(target, Is.Not.Null);
            Assert.That(target.Message, Is.EqualTo(expectedMessage));
        }
コード例 #2
0
        public void Should_have_constructor_with_error_message_and_inner_exception()
        {
            var expectedMessage = "Message";
            var expectedInnerException = new Exception("Inner Message");

            var target = new ValidationException(expectedMessage, expectedInnerException);

            Assert.That(target, Is.Not.Null);
            Assert.That(target.Message, Is.EqualTo(expectedMessage));
            Assert.That(target.InnerException, Is.SameAs(expectedInnerException));
        }
コード例 #3
0
        public void Should_have_empty_constructor()
        {
            var target = new ValidationException();

            Assert.That(target, Is.Not.Null);
        }