public void ValidationMetadata()
 {
     ValidationHelperTestPage page = new ValidationHelperTestPage();
     Assert.IsNull(ValidationHelper.GetValidationMetadata(page.nameContentControl));
     ValidationMetadata vmd = new ValidationMetadata();
     vmd.Caption = "ValidationMetadata";
     ValidationHelper.SetValidationMetadata(page.nameContentControl, vmd);
     Assert.AreEqual(vmd, ValidationHelper.GetValidationMetadata(page.nameContentControl));
     ValidationHelper.SetValidationMetadata(page.nameContentControl, null);
     Assert.IsNull(ValidationHelper.GetValidationMetadata(page.nameContentControl));
     ExceptionHelper.ExpectArgumentNullException(
         delegate { ValidationHelper.GetValidationMetadata(null); }, 
         "inputControl");
     ExceptionHelper.ExpectArgumentNullException(
         delegate { ValidationHelper.SetValidationMetadata(null, vmd); }, 
         "inputControl");
 }
Beispiel #2
0
        public void ValidationMetadata()
        {
            ValidationHelperTestPage page = new ValidationHelperTestPage();

            Assert.IsNull(ValidationHelper.GetValidationMetadata(page.nameContentControl));
            ValidationMetadata vmd = new ValidationMetadata();

            vmd.Caption = "ValidationMetadata";
            ValidationHelper.SetValidationMetadata(page.nameContentControl, vmd);
            Assert.AreEqual(vmd, ValidationHelper.GetValidationMetadata(page.nameContentControl));
            ValidationHelper.SetValidationMetadata(page.nameContentControl, null);
            Assert.IsNull(ValidationHelper.GetValidationMetadata(page.nameContentControl));
            ExceptionHelper.ExpectArgumentNullException(
                delegate { ValidationHelper.GetValidationMetadata(null); },
                "inputControl");
            ExceptionHelper.ExpectArgumentNullException(
                delegate { ValidationHelper.SetValidationMetadata(null, vmd); },
                "inputControl");
        }