示例#1
0
        public void ForwardDataToReaders(Reader.Reader reader, DeltaCD deltaCD)
        {
            var    collection = new DeltaCD();
            string temp       = string.Empty;

            if (deltaCD.Add.Count > 0)
            {
                collection.Add.Add(deltaCD.Add[0]);
                for (int i = 0; i < 9; i++)
                {
                    collection.Update.Add(deltaCD.Update[i]);
                }
            }
            else
            {
                for (int i = 0; i < 10; i++)
                {
                    collection.Update.Add(deltaCD.Update[i]);
                }
            }
            temp = collection.ToString();
            Logger.Log(LogComponent.REPLICATOR_RECEIVER, LogComponent.READER, DateTime.Now, temp);

            reader.ReceivedData = collection;
        }
示例#2
0
        public void DeltaCD_ToString_Test()
        {
            var add = new List <CollectionDescription>
            {
                new CollectionDescription(1, 2, new HistoricalCollection())
            };
            var update = new List <CollectionDescription>
            {
                new CollectionDescription(1, 2, new HistoricalCollection()),
                new CollectionDescription(3, 4, new HistoricalCollection()),
                new CollectionDescription(5, 6, new HistoricalCollection()),
            };

            var result = new DeltaCD(add, update);

            Assert.IsTrue(result.ToString() == "\n\t[DATASET:2]:\n\t[DATASET:2]:\n\t[DATASET:4]:\n\t[DATASET:6]:");
        }