public void CanValidate () { TimeSpan t = new TimeSpan (1000); TimeSpanValidator v = new TimeSpanValidator (t, t); Assert.IsTrue (v.CanValidate (typeof (TimeSpan)), "A1"); Assert.IsFalse (v.CanValidate (typeof (int)), "A2"); Assert.IsFalse (v.CanValidate (typeof (long)), "A3"); }
public void Validate_Resolution () { TimeSpanValidator v = new TimeSpanValidator (new TimeSpan (20000), new TimeSpan (50000), false, 2); v.Validate (TimeSpan.FromTicks (40000)); }
public void Validate_Exclusive_fail3 () { TimeSpanValidator v = new TimeSpanValidator (new TimeSpan (5000), new TimeSpan (10000), true); v.Validate (new TimeSpan (7000)); }
public void Validate_Inclusive () { TimeSpanValidator v = new TimeSpanValidator (new TimeSpan (5000), new TimeSpan (10000), false); v.Validate (new TimeSpan (5000)); v.Validate (new TimeSpan (10000)); }
public void Validate_inRange () { TimeSpanValidator v = new TimeSpanValidator (new TimeSpan (5000), new TimeSpan (10000)); v.Validate (new TimeSpan (7000)); }