IsValid() public method

Determines whether the specified value of the object is valid.
public IsValid ( object value ) : bool
value object The value of the object to validate.
return bool
        public void IsValidTests()
        {
            var attribute = new DateAttribute();

            Assert.IsTrue(attribute.IsValid(null)); // Don't check for required
            Assert.IsTrue(attribute.IsValid(DateTime.Now));
            Assert.IsTrue(attribute.IsValid(DateTime.Now.ToShortDateString()));
            Assert.IsTrue(attribute.IsValid("12/31/2010"));
            Assert.IsFalse(attribute.IsValid(12));
            Assert.IsFalse(attribute.IsValid("12.90"));
            Assert.IsFalse(attribute.IsValid("February 24th"));
            Assert.IsFalse(attribute.IsValid("yesterday"));
            Assert.IsFalse(attribute.IsValid("80/80/2011"));
        }
        public void IsValidTests()
        {
            var attribute = new DateAttribute();

            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-us");

            Assert.IsTrue(attribute.IsValid(null)); // Don't check for required
            Assert.IsTrue(attribute.IsValid(DateTime.Now));
            Assert.IsTrue(attribute.IsValid(DateTime.Now.ToShortDateString()));
            Assert.IsTrue(attribute.IsValid("12/31/2010"));
            Assert.IsFalse(attribute.IsValid(12));
            Assert.IsFalse(attribute.IsValid("12.90"));
            Assert.IsFalse(attribute.IsValid("February 24th"));
            Assert.IsFalse(attribute.IsValid("yesterday"));
            Assert.IsFalse(attribute.IsValid("80/80/2011"));
        }