상속: IWriter
예제 #1
0
        private static void AreEqual(LoggedData loggedData, TSK tsk, Catalog catalog, string cardPath)
        {
            var grower = catalog.Growers.SingleOrDefault(x => x.Id.ReferenceId == loggedData.GrowerId);
            var farm = catalog.Farms.SingleOrDefault(x => x.Id.ReferenceId == loggedData.FarmId);
            var field = catalog.Fields.SingleOrDefault(x => x.Id.ReferenceId == loggedData.FieldId);

            if(grower != null)
                Assert.AreEqual(grower.Id.FindIsoId(), tsk.C);
            if (farm != null)
                Assert.AreEqual(farm.Id.FindIsoId(), tsk.D);
            if (field != null)
                Assert.AreEqual(field.Id.FindIsoId(), tsk.E);

            if(loggedData.TimeScopes != null && loggedData.TimeScopes.Any())
            {
                var tims = tsk.Items.Where(x => x.GetType() == typeof(TIM)).Cast<TIM>().ToList();
                TimAssert.AreEqual(loggedData.TimeScopes, tims);
            }

            if(loggedData.OperationData != null && loggedData.OperationData.Any())
            {
                var tlgs = tsk.Items.Where(x => x.GetType() == typeof(TLG)).Cast<TLG>().ToList();
                TlgAssert.AreEqual(loggedData.OperationData.ToList(), tlgs, catalog, cardPath);
            }
        }
예제 #2
0
        public List<TSK> Read(XPathNodeIterator iterator)
        {
            var tsks = new List<TSK>();
            if (iterator.Count == 0)
                return tsks;

            foreach (XPathNavigator node in iterator)
            {
                if (node.SelectChildren("TLG", node.NamespaceURI).Count == 0)
                    continue;

                var tsk = new TSK
                {
                    A = GetStringValue(node, "A"),
                    B = GetStringValue(node, "B"),
                    C = GetStringValue(node, "C"),
                    D = GetStringValue(node, "D"),
                    E = GetStringValue(node, "E"),
                    F = GetStringValue(node, "F"),
                    G = GetEnumValue(node, "G"),
                    H = GetByteValue(node, "H"),
                    I = GetByteValue(node, "I"),
                    J = GetByteValue(node, "J"),
                    Items = GetItems(node),
                };

                tsks.Add(tsk);
            }

            return tsks;
        }
예제 #3
0
 public void Setup()
 {
     _tsk = new TSK();
     _output = new StringBuilder();
     _xmlBuilder = XmlWriter.Create(_output);
 }
예제 #4
0
        public void Setup()
        {
            _tsk = new TSK();
            _tsks = new List<TSK>{ _tsk };
            _dataPath = Path.GetTempPath();
            _documents = new Documents();
            _catalog = new Catalog();
            _linkIds = new Dictionary<string, List<UniqueId>>();

            _dataModel = new ApplicationDataModel();
            _dataModel.Documents = _documents;
            _dataModel.Catalog = _catalog;

            _operationDataMapper = new Mock<IOperationDataMapper>();

            _loggedDataMapper = new LoggedDataMapper(_operationDataMapper.Object);
        }
예제 #5
0
        public void Setup()
        {
            _task = new TSK();
            _taskList = new List<TSK> {_task};
            _dataPath = Path.GetTempPath();
            _dataModel = new ApplicationDataModel {Catalog = new Catalog(), Documents = new Documents()};
            _linkedIds = new Dictionary<string, List<UniqueId>>();

            _statusUpdateMapperMock = new Mock<IStatusUpdateMapper>();

            _mapper = new WorkOrderMapper(_statusUpdateMapperMock.Object);
        }