예제 #1
0
        public bool LoadFromFile(string taskDataFile)
        {
            if (!LoadXmlFile(taskDataFile))
            {
                return(false);
            }

            if (!VerifyIsoVersion())
            {
                return(false);
            }

            LinkedIds    = LinkListLoader.Load(this);
            Units        = UnitLoader.Load(this);
            Customers    = CustomerLoader.Load(this);
            Farms        = FarmLoader.Load(this);
            Crops        = CropLoader.Load(this);
            Fields       = FieldLoader.Load(this);
            Products     = ProductLoader.Load(this);
            ProductMixes = ProductMixLoader.Load(this);
            Workers      = WorkerLoader.Load(this);
            Comments     = CommentLoader.Load(this);
            Tasks        = TaskLoader.Load(this);

            RasterPrescriptions = PrescriptionLoader.Load(this);
            Machines            = DeviceLoader.Load(this);

            return(true);
        }
예제 #2
0
        public void GivenTaskDocumentWithPrescriptionWhenLoadThenUniqueIdIsSet()
        {
            TaskDataDocument taskDocument = CreateTaskDocument();

            var result = PrescriptionLoader.Load(taskDocument).First();

            Assert.AreEqual(1, result.Id.UniqueIds.Count);
            Assert.AreEqual("TSK0", result.Id.UniqueIds.First().Id);
            Assert.AreEqual(IdTypeEnum.String, result.Id.UniqueIds.First().IdType);
            Assert.AreEqual("http://dictionary.isobus.net/isobus/", result.Id.UniqueIds.First().Source);
        }