Beispiel #1
0
            protected override void EstablishContext()
            {
                base.EstablishContext();
                IoDevice = new PHmiModel.Entities.IoDevice
                {
                    Name = "IoDevice",
                    Id   = 1
                };
                IoDevices = new EnumerableQuery <PHmiModel.Entities.IoDevice>(new [] { IoDevice });
                Context.Setup(context => context.Get <PHmiModel.Entities.IoDevice>()).Returns(IoDevices);

                IoDeviceRunTarget = new Mock <IIoDeviceRunTarget>();
                IoDeviceRunTargetFactory.Setup(f => f.Create(TimeService.Object, IoDevice))
                .Returns(IoDeviceRunTarget.Object);
                CyclicRunner = new Mock <ICyclicRunner>();
                CyclicRunnerFactory.Setup(f => f.Create(IoDeviceRunTarget.Object)).Returns(CyclicRunner.Object);
            }
Beispiel #2
0
            protected override void EstablishContext()
            {
                base.EstablishContext();
                AlarmCategory = new AlarmCategory
                {
                    Name = "AlarmCategory",
                    Id   = RandomGenerator.GetRandomInt32()
                };
                Categories = new EnumerableQuery <AlarmCategory>(new[] { AlarmCategory });
                Context.Setup(context => context.Get <AlarmCategory>()).Returns(Categories);

                RunTarget = new Mock <IAlarmsRunTarget>();
                AlarmsRunTargetFactory.Setup(f => f.Create(DataDbConStr, ProjectRunner, AlarmCategory, TimeService.Object))
                .Returns(RunTarget.Object);
                CyclicRunner = new Mock <ICyclicRunner>();
                CyclicRunnerFactory.Setup(f => f.Create(RunTarget.Object)).Returns(CyclicRunner.Object);
            }
Beispiel #3
0
 public void Test()
 {
     CyclicRunnerFactory.Verify(f => f.Create(RunTarget.Object), Times.Once());
 }