示例#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"));
        }