Ejemplo n.º 1
0
        private static Dictionary <string, string> CreateValidatorAndRun(string fieldName, object valueToSet, Dictionary <string, string> model)
        {
            var obj = new ValidationParamObject
            {
                Validator = CreateSimpleValidatorText(fieldName, valueToSet),
                Model     = model
            };

            var result = ValidationServices.ValidateModel(obj);

            Assert.IsTrue(result.IsValid);
            return(model);
        }
Ejemplo n.º 2
0
        public void RemoteMutualGroupValidatorTest()
        {
            var resourceDictrionary = Common.GetEmbeddedResourceText("QA.Core.DPC.Loader.RemoteValidators.Xaml.site_35.xaml");
            var validator           = Common.GetEmbeddedResourceText("QA.Core.DPC.Loader.RemoteValidators.Xaml.content_309.xaml");
            var model = new Dictionary <string, string>
            {
                { "CONTENT_ITEM_ID", "2323" },
                { "STATUS_TYPE_ID", "32" },
                { "field_1279", "1234,5678" },
                { "field_1385", "44" }
            };
            var paramObject = new ValidationParamObject()
            {
                Model           = model,
                Validator       = validator,
                DynamicResource = resourceDictrionary
            };

            ValidationServices.ValidateModel(paramObject);
        }