Пример #1
0
        public void WithInnerException_WhenInnerExceptionIsNotNull_ReturnsIntranetExceptionBuilder()
        {
            IIntranetExceptionBuilder sut = CreateSut();

            IIntranetExceptionBuilder result = sut.WithInnerException(_fixture.Create <Exception>());

            Assert.That(result, Is.EqualTo(sut));
        }
Пример #2
0
        public void Build_WhenCalledForIntranetRepositoryExceptionWithInnerException_AssertInnerExceptionIsCorrect()
        {
            IIntranetExceptionBuilder sut = CreateSut(ErrorCode.RepositoryError, _fixture.Create <string>(), _fixture.Create <string>());

            Exception             innerException = _fixture.Create <Exception>();
            IntranetExceptionBase result         = sut.WithInnerException(innerException).Build();

            Assert.That(result.InnerException, Is.EqualTo(innerException));
        }
Пример #3
0
        public void Build_WhenCalledForIntranetValidationExceptionWithInnerException_AssertInnerExceptionIsCorrect()
        {
            IIntranetExceptionBuilder sut = CreateSut(ErrorCode.ValueNotGreaterThanZero, _fixture.Create <string>());

            Exception             innerException = _fixture.Create <Exception>();
            IntranetExceptionBase result         = sut.WithInnerException(innerException).Build();

            Assert.That(result.InnerException, Is.EqualTo(innerException));
        }
Пример #4
0
        public void Build_WhenCalledForIntranetQueryBusExceptionWithInnerException_AssertInnerExceptionIsCorrect()
        {
            IIntranetExceptionBuilder sut = CreateSut(ErrorCode.NoQueryHandlerSupportingQuery, _fixture.Create <string>(), _fixture.Create <string>());

            Exception             innerException = _fixture.Create <Exception>();
            IntranetExceptionBase result         = sut.WithInnerException(innerException).Build();

            Assert.That(result.InnerException, Is.EqualTo(innerException));
        }
Пример #5
0
        public void WithInnerException_WhenInnerExceptionIsNull_ThrowsArgumentNullException()
        {
            IIntranetExceptionBuilder sut = CreateSut();

            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.WithInnerException(null));

            Assert.That(result.ParamName, Is.EqualTo("innerException"));
        }