Created
March 19, 2015 06:38
-
-
Save ionoy/b50e89a936e38a648ee7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new TestScheduler().With(sc => { | |
var client = Substitute.For<IQuadClient>(); | |
var packets = new Subject<IMavLinkPacket>(); | |
client.Packets.Returns(packets); | |
var quad = new Quad(client, MessageBus.Current); | |
packets.OnNext(new Mav.mavlink_heartbeat_t { base_mode = (byte)Mav.MAV_MODE_FLAG.SAFETY_ARMED }); | |
sc.AdvanceByMs(1); | |
quad.State = new LandState(); | |
sc.AdvanceByMs(1); | |
Assert.AreEqual(ArduCopterMode.Land, quad.DesiredMode); | |
Assert.AreEqual(1000, quad.RcOverride.Throttle); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment