public void ValidateValue_WithoutValidValue_ThrowsException() { var betweenOneAndTen = new ComparableExodataDeclaration <int>(1, 10, 5); var resolver = new StandardExodataResolver(); resolver.Bind(betweenOneAndTen, 42); ExodataDeclaration.SetResolver(resolver); Assert.Throws <ExodataValidationException <int> >(() => betweenOneAndTen.Get()); }
public void ValidateValue_WithValidValue_DoesNotThrowException() { var betweenOneAndTen = new ComparableExodataDeclaration <int>(1, 10, 5); var resolver = new StandardExodataResolver(); resolver.Bind(betweenOneAndTen, 7); ExodataDeclaration.SetResolver(resolver); Assert.AreEqual(7, betweenOneAndTen.Get()); }