예제 #1
0
        public void BeSerialisable()
        {
            var verificationResult = new VerificationResult("Aha", false);
            var sut = new VerificationFailedException(verificationResult, "This is a special message!").RoundTripWithBinaryFormatter();

            sut.VerificationResult.AssertEquals(verificationResult);
            Assert.Equal("This is a special message!", sut.Message);
            Assert.Null(sut.InnerException);
        }
예제 #2
0
        public void AcceptVerificationResultAndMessage()
        {
            var verificationResult = new VerificationResult("Aha", false);
            var sut = new VerificationFailedException(verificationResult, "This is a bespoke message!");

            sut.VerificationResult.AssertEquals(verificationResult);
            Assert.Equal("This is a bespoke message!", sut.Message);
            Assert.Null(sut.InnerException);
        }
예제 #3
0
        public void AcceptVerificationResult()
        {
            var verificationResult = new VerificationResult("Aha", false);
            var sut = new VerificationFailedException(verificationResult);

            sut.VerificationResult.AssertEquals(verificationResult);
            Assert.Equal("Verification failed.", sut.Message);
            Assert.Null(sut.InnerException);
        }
예제 #4
0
        public void AcceptVerificationResultMessageAndInnerException()
        {
            var innerException     = new Exception();
            var verificationResult = new VerificationResult("Aha", false);
            var sut = new VerificationFailedException(verificationResult, "This is a message!", innerException);

            sut.VerificationResult.AssertEquals(verificationResult);
            Assert.Equal("This is a message!", sut.Message);
            Assert.Same(innerException, sut.InnerException);
        }