示例#1
0
        public void CanValidateForCreation()
        {
            dynamic model  = this.GetResource("test.validator");
            dynamic record = new ExpandoObject();

            record.required_field = null;
            record.readonly_field = "hello!";

            var vex = Assert.Throws <ValidationException>(() =>
            {
                EntityValidator.ValidateRecordForCreation(model, record);
            });

            Assert.AreEqual(1, vex.Fields.Count);
        }