public void RequestDataAndShouldBeAtleastOne() { ActorOf(CollectorActor.Props(goodIp, Helpers.DeviceID.ID)).Tell(new CollectorActor.CollectionRequest()); var data = ExpectMsg <DeviceReading>(TimeSpan.FromMilliseconds(5000)); Assert.IsTrue(data.aircraft.Any()); }
public void RequestDataAndValidateDevice() { ActorOf(CollectorActor.Props(goodIp, Helpers.DeviceID.ID)).Tell(new CollectorActor.CollectionRequest()); var data = ExpectMsg <DeviceReading>(TimeSpan.FromMilliseconds(5000)); Assert.AreEqual(data.deviceId, Helpers.DeviceID.ID); }
public void MakeSureDataIsReturned() { ActorOf(CollectorActor.Props(goodIp, Helpers.DeviceID.ID)).Tell(new CollectorActor.CollectionRequest()); var data = ExpectMsg <DeviceReading>(TimeSpan.FromSeconds(15)); Assert.IsNotNull(data); }
public void MakeSureFailedDataIsReturned() { var actor = ActorOf(CollectorActor.Props(badIp, Helpers.DeviceID.ID)); actor.Tell(new CollectorActor.CollectionRequest()); ExpectMsg <CollectorActor.CollectionFailed>(TimeSpan.FromSeconds(5)); }
public void MakeSureDataIsRecent() { ActorOf(CollectorActor.Props(goodIp, Helpers.DeviceID.ID)).Tell(new CollectorActor.CollectionRequest()); var data = ExpectMsg <DeviceReading>(TimeSpan.FromSeconds(10)); var now = DateTimeOffset.Now.ToUnixTimeSeconds(); Assert.IsTrue(Math.Abs(data.now - now) < 5); }