IsValid() protected method

Validates the specified value with respect to the current validation attribute.
protected IsValid ( object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext ) : System.ComponentModel.DataAnnotations.ValidationResult
value object The value to validate.
validationContext System.ComponentModel.DataAnnotations.ValidationContext The context information about the validation operation.
return System.ComponentModel.DataAnnotations.ValidationResult
        public void IsValidFallbackTests()
        {
            var attribute = new RequiredHttpAttribute();

            Assert.IsTrue(attribute.IsValid("A"));
            Assert.IsTrue(attribute.IsValid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"));
            Assert.IsFalse(attribute.IsValid(" "));
            Assert.IsFalse(attribute.IsValid(null));
            Assert.IsFalse(attribute.IsValid(string.Empty));
        }
        public void IsValidMultiMethodRequiredTests()
        {
            var attribute = new RequiredHttpAttribute()
            {
                HttpMethod = "GeT|PosT"
            };
            HttpRequest request = new HttpRequest("test", "http://localhost", string.Empty)
            {
                RequestType = "post"
            };
            HttpResponse response = new HttpResponse(HttpWriter.Null);
            HttpContext.Current = new HttpContext(request, response);

            Assert.IsTrue(attribute.IsValid("A"));
            Assert.IsTrue(attribute.IsValid("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"));
            Assert.IsFalse(attribute.IsValid(" "));
            Assert.IsFalse(attribute.IsValid(null));
            Assert.IsFalse(attribute.IsValid(string.Empty));
        }