public void Test_DocList_3() { using (var app = new AzosApplication(null, BASE_CONF)) { var doc = new DocList(); doc.IMin = 5000; doc.DList = new List <object> { new DocCompositeField { D1 = new DocDirectField { S1 = "zzzzkey" }, D2 = new DocDirectField { S1 = "key" } } }; var ve = doc.Validate(app); Aver.IsNotNull(ve); if (ve is FieldValidationException fve) { Console.WriteLine(fve.Message); Aver.IsTrue(fve.Message.Contains("list")); } else { Aver.Fail("Not a FVExcp"); } ((DocCompositeField)doc.DList[0]).D1.S1 = "key"; ve = doc.Validate(app); Aver.IsNull(ve); } }
public void Test_DocList_2() { using (var app = new AzosApplication(null, BASE_CONF)) { var doc = new DocList(); doc.IMin = 5;//below acceptable doc.DList = new List <object> { new DocCompositeField { D1 = new DocDirectField { S1 = "key" }, D2 = new DocDirectField { S1 = "key" } } }; var ve = doc.Validate(app); Aver.IsNotNull(ve); if (ve is FieldValidationException fve) { fve.Message.See(); Aver.IsTrue(fve.Message.Contains("min")); } else { Aver.Fail(Constants.ERR_NOT_FVEXCP); } doc.IMin = 5000; ve = doc.Validate(app); Aver.IsNull(ve); } }
public void Test_DocList_4() { using (var app = new AzosApplication(null, BASE_CONF)) { var doc = new DocList(); doc.IMin = 1000; doc.DList = new List <object> { null, null, null, new DocCompositeField { D1 = new DocDirectField { S1 = "key" }, D2 = new DocDirectField { S1 = "key" } } }; Aver.IsNull(doc.Validate(app)); } }