Пример #1
0
        public IEnumerable <IEdiMessage> Parse(string contents)
        {
            var segments = _segmentSplitter.Split(contents);
            var fileInfo = _fileReader.Read(segments);

            return(_generator.GenerateMessages(fileInfo, BusinessPartner.Initech));
        }
Пример #2
0
        private List <Message> GenerateMessages(List <string> nodesIds, DateTime currentTime, List <INode> nodes)
        {
            var messages = _messageGenerator.GenerateMessages(_settings.MessagesSettings, nodesIds, currentTime);

            foreach (var message in messages)
            {
                var node = nodes.Find(x => x.GetId().Equals(message.StartId));
                node !.Receive(message);
            }

            return(messages);
        }