Beispiel #1
0
        private static void AreEqual(XmlNode ctpNode, Crop crop, Catalog catalog, Dictionary <string, List <UniqueId> > linkList)
        {
            UniqueIdAssert.AreEqual(linkList, ctpNode.GetXmlAttribute("A"), crop.Id.UniqueIds);
            Assert.AreEqual(ctpNode.GetXmlAttribute("A"), crop.Id.FindIsoId());
            Assert.AreEqual(ctpNode.GetXmlAttribute("B"), crop.Name);

            var matchingCropVarieties = catalog.Products.Where(x => x is CropVariety).Cast <CropVariety>().Where(cv => cv.CropId == crop.Id.ReferenceId).ToList();

            CropVarietyAssert.AreEqual(ctpNode.SelectNodes("CVT"), matchingCropVarieties, linkList);
        }
Beispiel #2
0
        public static void AreEqual(XmlNode productNode, CropNutritionProduct fertilizerProduct, Dictionary <string, List <UniqueId> > linkList)
        {
            if (productNode.GetXmlAttribute("A") == null || productNode.GetXmlAttribute("B") == null)
            {
                return;
            }

            UniqueIdAssert.AreEqual(linkList, productNode.GetXmlAttribute("A"), fertilizerProduct.Id.UniqueIds);
            Assert.AreEqual(productNode.GetXmlAttribute("A"), fertilizerProduct.Id.FindIsoId());
            Assert.AreEqual(productNode.GetXmlAttribute("B"), fertilizerProduct.Description);
        }
Beispiel #3
0
 private static void AreEqual(XmlNode ctrNode, Grower grower, Dictionary <string, List <UniqueId> > linkList)
 {
     UniqueIdAssert.AreEqual(linkList, ctrNode.GetXmlAttribute("A"), grower.Id.UniqueIds);
     Assert.AreEqual(ctrNode.GetXmlAttribute("A"), grower.Id.FindIsoId());
     CheckName(ctrNode, grower);
     Assert.AreEqual(ctrNode.GetXmlAttribute("D"), grower.ContactInfo.AddressLine1);
     Assert.AreEqual(ctrNode.GetXmlAttribute("E"), grower.ContactInfo.PoBoxNumber);
     Assert.AreEqual(ctrNode.GetXmlAttribute("F"), grower.ContactInfo.PostalCode);
     Assert.AreEqual(ctrNode.GetXmlAttribute("G"), grower.ContactInfo.City);
     Assert.AreEqual(ctrNode.GetXmlAttribute("H"), grower.ContactInfo.StateOrProvince);
     Assert.AreEqual(ctrNode.GetXmlAttribute("I"), grower.ContactInfo.Country);
     CheckContacts(ctrNode, grower.ContactInfo.Contacts);
 }
Beispiel #4
0
        public static void AreEqual(XmlNode productNode, XmlNodeList productNodes, ProductMix productMix, Catalog catalog, Dictionary <string, List <UniqueId> > linkList)
        {
            if (productNode.GetXmlAttribute("A") == null || productNode.GetXmlAttribute("B") == null)
            {
                return;
            }

            UniqueIdAssert.AreEqual(linkList, productNode.GetXmlAttribute("A"), productMix.Id.UniqueIds);
            Assert.AreEqual(productNode.GetXmlAttribute("A"), productMix.Id.FindIsoId());
            Assert.AreEqual(productNode.GetXmlAttribute("B"), productMix.Description);

            var prnNodes = productNode.SelectNodes("PRN");

            ProductComponentAssert.AreEqual(prnNodes, productMix.ProductComponents, productNodes, catalog, linkList);
        }
Beispiel #5
0
        private static void AreEqual(XmlNode fieldNode, Field field, Catalog catalog, Dictionary <string, List <UniqueId> > linkList)
        {
            if (fieldNode.GetXmlAttribute("A") == null || fieldNode.GetXmlAttribute("C") == null || fieldNode.GetXmlAttribute("D") == null)
            {
                return;
            }

            UniqueIdAssert.AreEqual(linkList, fieldNode.GetXmlAttribute("A"), field.Id.UniqueIds);
            Assert.AreEqual(fieldNode.GetXmlAttribute("A"), field.Id.FindIsoId());
            Assert.AreEqual(fieldNode.GetXmlAttribute("C"), field.Description);

            CheckArea(fieldNode, field);
            CheckFarm(fieldNode, field, catalog);
            CheckBoundary(fieldNode, field, catalog);
            CheckGuidanceGroups(fieldNode, field, catalog, linkList);
            CheckCropZone(fieldNode, field, catalog);
        }
Beispiel #6
0
        private static void AreEqual(XmlNode farmNode, Farm farm, Catalog catalog, Dictionary <string, List <UniqueId> > linkList)
        {
            UniqueIdAssert.AreEqual(linkList, farmNode.GetXmlAttribute("A"), farm.Id.UniqueIds);
            Assert.AreEqual(farmNode.GetXmlAttribute("A"), farm.Id.FindIsoId());
            Assert.AreEqual(farmNode.GetXmlAttribute("B"), farm.Description);

            Assert.AreEqual(farmNode.GetXmlAttribute("C"), farm.ContactInfo.AddressLine1);
            Assert.AreEqual(farmNode.GetXmlAttribute("D"), farm.ContactInfo.PoBoxNumber);
            Assert.AreEqual(farmNode.GetXmlAttribute("E"), farm.ContactInfo.PostalCode);
            Assert.AreEqual(farmNode.GetXmlAttribute("F"), farm.ContactInfo.City);
            Assert.AreEqual(farmNode.GetXmlAttribute("G"), farm.ContactInfo.StateOrProvince);
            Assert.AreEqual(farmNode.GetXmlAttribute("H"), farm.ContactInfo.Country);

            var customerId = farmNode.GetXmlAttribute("I");

            if (!String.IsNullOrEmpty(customerId))
            {
                var grower = catalog.Growers.Single(x => x.Id.ReferenceId == farm.GrowerId);
                Assert.AreEqual(customerId, grower.Id.FindIsoId());
            }
        }
Beispiel #7
0
 private static void AreEqual(XmlNode cropVarietyNode, CropVarietyProduct cropVariety, Dictionary <string, List <UniqueId> > linkList)
 {
     UniqueIdAssert.AreEqual(linkList, cropVarietyNode.GetXmlAttribute("A"), cropVariety.Id.UniqueIds);
     Assert.AreEqual(cropVarietyNode.GetXmlAttribute("A"), cropVariety.Id.FindIsoId());
     Assert.AreEqual(cropVarietyNode.GetXmlAttribute("B"), cropVariety.Description);
 }