public void WithInnerException_WhenInnerExceptionIsNotNull_ReturnsIntranetExceptionBuilder() { IIntranetExceptionBuilder sut = CreateSut(); IIntranetExceptionBuilder result = sut.WithInnerException(_fixture.Create <Exception>()); Assert.That(result, Is.EqualTo(sut)); }
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)); }
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)); }
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)); }
public void WithInnerException_WhenInnerExceptionIsNull_ThrowsArgumentNullException() { IIntranetExceptionBuilder sut = CreateSut(); ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.WithInnerException(null)); Assert.That(result.ParamName, Is.EqualTo("innerException")); }