예제 #1
0
        public void TestThatInRangeValidatesWhetherValueIsInRange(int value, int startValue, int endValue, bool expectedResult)
        {
            IDomainObjectValidations sut = new DomainObjectValidations();

            Assert.That(sut, Is.Not.Null);

            bool result = sut.InRange(value, new Range <int>(startValue, endValue));

            Assert.That(result, Is.EqualTo(expectedResult));
        }
예제 #2
0
        public void TestThatInRangeThrowsArgumentNullExceptionWhenRangeIsNull()
        {
            IDomainObjectValidations sut = new DomainObjectValidations();

            Assert.That(sut, Is.Not.Null);

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

            TestHelper.AssertArgumentNullExceptionIsValid(result, "range");
        }