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); }
public void Test() { IoDeviceRunTargetFactory.Verify(f => f.Create(TimeService.Object, IoDevice), Times.Once()); }