public void TestMinExclusive() { NumericMinRule rule = new NumericMinRule(1, false); TestExclusive <SByte>(rule, 2, 1, 0); TestExclusive <Byte>(rule, 2, 1, 0); TestExclusive <Int16>(rule, 2, 1, 0); TestExclusive <UInt16>(rule, 2, 1, 0); TestExclusive <Int32>(rule, 2, 1, 0); TestExclusive <UInt32>(rule, 2, 1, 0); TestExclusive <Int64>(rule, 2, 1, 0); TestExclusive <UInt64>(rule, 2, 1, 0); TestExclusive <Single>(rule, 2, 1, 0); TestExclusive <Double>(rule, 2, 1, 0); }
private void TestExclusive <T>(NumericMinRule rule, T valid, T equal, T invalid) { Assert.True(rule.Validate((T)valid, null)); Assert.False(rule.Validate((T)equal, null)); Assert.False(rule.Validate((T)invalid, null)); }