예제 #1
0
        public void WithMethodBase_WhenMethodBaseIsNotNull_ReturnsIntranetExceptionBuilder()
        {
            IIntranetExceptionBuilder sut = CreateSut();

            IIntranetExceptionBuilder result = sut.WithMethodBase(MethodBase.GetCurrentMethod());

            Assert.That(result, Is.EqualTo(sut));
        }
예제 #2
0
        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));
        }
예제 #3
0
        public void WithMethodBase_WhenMethodBaseIsNull_ThrowsArgumentNullException()
        {
            IIntranetExceptionBuilder sut = CreateSut();

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

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