public void WithValidatingType_WhenValidatingTypeIsNotNull_ReturnsIntranetExceptionBuilder()
        {
            IIntranetExceptionBuilder sut = CreateSut();

            IIntranetExceptionBuilder result = sut.WithValidatingType(typeof(WithValidatingTypeTests));

            Assert.That(result, Is.EqualTo(sut));
        }
示例#2
0
        public void Build_WhenCalledForIntranetValidationExceptionWithValidatingType_AssertValidatingTypeIsCorrect()
        {
            IIntranetExceptionBuilder sut = CreateSut(ErrorCode.ValueNotGreaterThanZero, _fixture.Create <string>());

            Type validatingType = GetType();
            IntranetValidationException result = (IntranetValidationException)sut.WithValidatingType(validatingType).Build();

            Assert.That(result.ValidatingType, Is.EqualTo(validatingType));
        }
        public void WithValidatingType_WhenValidatingTypeIsNull_ThrowsArgumentNullException()
        {
            IIntranetExceptionBuilder sut = CreateSut();

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

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