public void ShouldBeGreaterThanZero_WhenValueIsGreaterThanZero_ReturnsIntegerValidator()
        {
            IIntegerValidator sut = CreateSut();

            IValidator result = sut.ShouldBeGreaterThanZero(_random.Next(1, 5), GetType(), _fixture.Create <string>());

            Assert.That(result, Is.TypeOf <BusinessLogic.Validation.IntegerValidator>());
        }
        public void ShouldBeGreaterThanZero_WhenValueIsLowerThanZero_ThrowsIntranetValidationException()
        {
            IIntegerValidator sut = CreateSut();

            Type   validatingType              = GetType();
            string validatingField             = _fixture.Create <string>();
            IntranetValidationException result = Assert.Throws <IntranetValidationException>(() => sut.ShouldBeGreaterThanZero(_random.Next(1, 5) * -1, validatingType, validatingField));

            Assert.That(result.ErrorCode, Is.EqualTo(ErrorCode.ValueNotGreaterThanZero));
            Assert.That(result.ValidatingType, Is.EqualTo(validatingType));
            Assert.That(result.ValidatingField, Is.EqualTo(validatingField));
        }
        public void ShouldBeGreaterThanZero_WhenValidatingFieldIsWhiteSpace_ThrowsArgumentNullException()
        {
            IIntegerValidator sut = CreateSut();

            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.ShouldBeGreaterThanZero(_fixture.Create <int>(), GetType(), " "));

            Assert.That(result.ParamName, Is.EqualTo("validatingField"));
        }
        public void ShouldBeGreaterThanZero_WhenValidatingTypeIsNull_ThrowsArgumentNullException()
        {
            IIntegerValidator sut = CreateSut();

            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.ShouldBeGreaterThanZero(_fixture.Create <int>(), null, _fixture.Create <string>()));

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