Collects error messages from validation
Inheritance: IValidationDictionary, IDataErrorInfo
Ejemplo n.º 1
0
        public void ValidateForModelWithoutAttributes()
        {
            var value = 2;
            var state = new DefaultValidationWrapper();
            Assert.True(state.IsValid);

            value.ValidateFor<MyTest>(d => d.Id, state);
            Assert.True(state.IsValid);
            Assert.NotEqual("Req", state["Body"]);
        }
Ejemplo n.º 2
0
        public void ValidateForModel()
        {
            var value = "";
            var state = new DefaultValidationWrapper();
            Assert.True(state.IsValid);

            value.ValidateFor<MyTest>(d=>d.Body,state);
            Assert.False(state.IsValid);
            Assert.Equal("Req", state["Body"]);
        }