示例#1
0
        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());
        }
示例#2
0
        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);
        }
示例#3
0
        public void MakeSureDataIsReturned()
        {
            ActorOf(CollectorActor.Props(goodIp, Helpers.DeviceID.ID)).Tell(new CollectorActor.CollectionRequest());
            var data = ExpectMsg <DeviceReading>(TimeSpan.FromSeconds(15));

            Assert.IsNotNull(data);
        }
示例#4
0
        public void MakeSureFailedDataIsReturned()
        {
            var actor = ActorOf(CollectorActor.Props(badIp, Helpers.DeviceID.ID));

            actor.Tell(new CollectorActor.CollectionRequest());
            ExpectMsg <CollectorActor.CollectionFailed>(TimeSpan.FromSeconds(5));
        }
示例#5
0
        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);
        }