Пример #1
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     DigitalTag         = new DigitalTag(new DispatcherService(), 1, "name", () => "");
     ReturnedDigitalTag = IoDevice.AddDigTag(DigitalTag);
     NumericTag         = new NumericTag(new DispatcherService(), 1, "name", () => "", () => "", () => "", 0, 0);
     ReturnedNumericTag = IoDevice.AddNumTag(NumericTag);
 }
Пример #2
0
            protected override void EstablishContext()
            {
                base.EstablishContext();

                ReadDigTag   = new Mock <TagAbstract <bool?> >();
                ReadDigTagId = RandomGenerator.GetRandomInt32(int.MinValue + 1);
                ReadDigTag.SetupGet(t => t.Id).Returns(ReadDigTagId);
                IoDevice.AddDigTag(ReadDigTag.Object);

                DigitalTag   = new Mock <TagAbstract <bool?> >();
                DigitalTagId = ReadDigTagId - 1;
                DigitalTag.SetupGet(t => t.Id).Returns(DigitalTagId);
                IoDevice.AddDigTag(DigitalTag.Object);

                NumericTag   = new Mock <TagAbstract <double?> >();
                NumericTagId = RandomGenerator.GetRandomInt32(int.MinValue + 1);
                NumericTag.SetupGet(t => t.Id).Returns(NumericTagId);
                IoDevice.AddNumTag(NumericTag.Object);

                ReadNumericTag   = new Mock <TagAbstract <double?> >();
                ReadNumericTagId = NumericTagId - 1;
                ReadNumericTag.SetupGet(t => t.Id).Returns(ReadNumericTagId);
                IoDevice.AddNumTag(ReadNumericTag.Object);
            }