Beispiel #1
0
                protected override void EstablishContext()
                {
                    base.EstablishContext();
                    RemapTagsParameter = new RemapTagsParameter
                    {
                        IoDeviceId     = IoDeviceId,
                        DigWriteIds    = new [] { 20 },
                        DigWriteValues = new [] { true },
                        NumWriteIds    = new [] { 30 },
                        NumWriteValues = new [] { 33.3 },
                        DigReadIds     = new [] { DigReadId },
                        NumReadIds     = new [] { NumReadId }
                    };
                    IoDeviceRunTarget.Setup(t => t.GetDigitalValue(DigReadId)).Returns(DigReadValue).Verifiable();
                    IoDeviceRunTarget.Setup(t => t.GetNumericValue(NumReadId)).Returns(NumReadValue).Verifiable();

                    Notifications = new ReadOnlyObservableCollection <Notification>(
                        new ObservableCollection <Notification> {
                        new Notification(DateTime.Now, "Message", "ShortDesc", "LongDesc")
                    });
                    Reporter = new Mock <INotificationReporter>();
                    Reporter.SetupGet(r => r.Notifications).Returns(Notifications);
                    IoDeviceRunTarget.SetupGet(t => t.Reporter).Returns(Reporter.Object);

                    RemapTagsResult = Service.RemapTags(new [] { RemapTagsParameter });
                }
Beispiel #2
0
 public void Test()
 {
     IoDeviceRunTarget.Verify(t => t.EnterWriteLock(), Times.Never());
     IoDeviceRunTarget.Verify(t => t.ExitWriteLock(), Times.Never());
     IoDeviceRunTarget.Verify(t => t.EnterReadLock(), Times.Once());
     IoDeviceRunTarget.Verify(t => t.ExitReadLock(), Times.Once());
 }
Beispiel #3
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     SettedDigitalValue = false;
     IoDeviceRunTarget.SetDigitalValue(DigitalTag.Id, SettedDigitalValue);
     SettedWriteOnlyDigitalValue = false;
     IoDeviceRunTarget.SetDigitalValue(WriteOnlyDigitalTag.Id, SettedWriteOnlyDigitalValue);
     SettedNumericValue = new Random().Next();
     IoDeviceRunTarget.SetNumericValue(NumericTag.Id, SettedNumericValue);
     SettedWriteOnlyNumericValue = new Random().Next();
     IoDeviceRunTarget.SetNumericValue(WriteOnlyNumericTag.Id, SettedWriteOnlyNumericValue);
 }
            protected override void EstablishContext()
            {
                base.EstablishContext();
                SettedDigitalValue = false;
                IoDeviceRunTarget.SetDigitalValue(DigitalTag.id, SettedDigitalValue);
                SettedWriteOnlyDigitalValue = false;
                IoDeviceRunTarget.SetDigitalValue(WriteOnlyDigitalTag.id, SettedWriteOnlyDigitalValue);
                var random = new Random();

                SettedNumericValue = random.Next();
                IoDeviceRunTarget.SetNumericValue(NumericTag.id, SettedNumericValue);
                SettedWriteOnlyNumericValue = random.Next(Int16.MinValue, Int16.MaxValue);
                IoDeviceRunTarget.SetNumericValue(WriteOnlyNumericTag.id, SettedWriteOnlyNumericValue);
            }
Beispiel #5
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     CatchExceptionInEstablishContext = true;
     IoDeviceRunTarget.Clean();
 }
Beispiel #6
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     IoDeviceRunTarget.Run();
 }
Beispiel #7
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     IoDeviceRunTarget.Setup(t => t.GetDigitalValue(AlarmTag.DigTag.Id)).Returns(false);
 }
Beispiel #8
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     IoDeviceRunTarget.Setup(t => t.GetDigitalValue(AlarmTag.dig_tags.id)).Returns(true);
 }
Beispiel #9
0
 public void Test()
 {
     IoDeviceRunTarget.Verify(t => t.Dispose(), Times.Once());
 }
Beispiel #10
0
 public void SetNumTagsPerformed()
 {
     IoDeviceRunTarget.Verify(t => t.SetNumericValue(RemapTagsParameter.NumWriteIds[0], RemapTagsParameter.NumWriteValues[0]), Times.Once());
 }
Beispiel #11
0
 public void SetDigTagsPerformed()
 {
     IoDeviceRunTarget.Verify(t => t.SetDigitalValue(RemapTagsParameter.DigWriteIds[0], RemapTagsParameter.DigWriteValues[0]), Times.Once());
 }
Beispiel #12
0
 public void GetTagsPerformed()
 {
     IoDeviceRunTarget.Verify();
 }
Beispiel #13
0
 public void SetNumTagsNotPerformed()
 {
     IoDeviceRunTarget.Verify(t => t.SetNumericValue(It.IsAny <int>(), It.IsAny <double>()), Times.Never());
 }
Beispiel #14
0
 public void SetDigTagsNotPerformed()
 {
     IoDeviceRunTarget.Verify(t => t.SetDigitalValue(It.IsAny <int>(), It.IsAny <bool>()), Times.Never());
 }