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"]); }
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"]); }