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