Exemple #1
0
        public void Test_DocArray_3()
        {
            using (var app = new AzosApplication(null, BASE_CONF))
            {
                var doc = new DocArray();
                doc.IMin   = 5000;
                doc.DArray = new[] { 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");
                }


                doc.DArray[0].D1.S1 = "key";
                ve = doc.Validate(app);
                Aver.IsNull(ve);
            }
        }
Exemple #2
0
        public void Test_DocArray_2()
        {
            using (var app = new AzosApplication(null, BASE_CONF))
            {
                var doc = new DocArray();
                doc.IMin   = 5;//below acceptable
                doc.DArray = new[] { 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);
            }
        }
Exemple #3
0
 public void Test_DocArray_4()
 {
     using (var app = new AzosApplication(null, BASE_CONF))
     {
         var doc = new DocArray();
         doc.IMin   = 1000;
         doc.DArray = new[] { null, null, null, new DocCompositeField {
                                  D1 = new DocDirectField {
                                      S1 = "key"
                                  }, D2 = new DocDirectField {
                                      S1 = "key"
                                  }
                              } };
         Aver.IsNull(doc.Validate(app));
     }
 }