public void WithMethodBase_WhenMethodBaseIsNotNull_ReturnsIntranetExceptionBuilder() { IIntranetExceptionBuilder sut = CreateSut(); IIntranetExceptionBuilder result = sut.WithMethodBase(MethodBase.GetCurrentMethod()); Assert.That(result, Is.EqualTo(sut)); }
public void Build_WhenCalledForIntranetRepositoryExceptionWithMethodBase_AssertMethodBaseIsCorrect() { IIntranetExceptionBuilder sut = CreateSut(ErrorCode.RepositoryError, _fixture.Create <string>(), _fixture.Create <string>()); MethodBase methodBase = MethodBase.GetCurrentMethod(); IntranetRepositoryException result = (IntranetRepositoryException)sut.WithMethodBase(methodBase).Build(); Assert.That(result.MethodBase, Is.EqualTo(methodBase)); }
public void WithMethodBase_WhenMethodBaseIsNull_ThrowsArgumentNullException() { IIntranetExceptionBuilder sut = CreateSut(); ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.WithMethodBase(null)); Assert.That(result.ParamName, Is.EqualTo("methodBase")); }