public void TestBasicRangeGood() { var newObject = new object(); IValueExtractor ive = MockUtils.CreateExtractor(repository, 3.5d); var rv = new RangeValueValidator(ive, 0, 100); Assert.IsTrue(rv.Validate(newObject), "Range incorrect validation"); repository.VerifyAll(); }
public void TestBasicRangeTooLow() { var newObject = new object(); IValueExtractor ive = MockUtils.CreateExtractorForBasicRange(repository, -10.0f); var rv = new RangeValueValidator(ive, 0, 100); Assert.IsFalse(rv.Validate(newObject), "Range incorrect validation"); repository.VerifyAll(); }
public void CoreTestIValidatorReturnsSourceName() { var rng = new RFTestClass1(); IValueExtractor extractor = MockRepository.GenerateStub<IValueExtractor>(); extractor.Expect(obj => obj.ExtractValue(rng)).Return(100000.0f); extractor.Expect(obj => obj.SourceName).Return("TESTPNAME"); var v = new RangeValueValidator(extractor, 0.0, 1.0); SingleValidationResult res = v.Validate(rng); Assert.IsFalse(res, "Range Object does wrong validation."); Assert.That(res.SourceName, Is.EqualTo("TESTPNAME")); }