示例#1
0
        public async Task DisconnectAsync()
        {
            byte[][] expected = { new byte[] { 0xfe, 0x06 } };

            await debug.DisconnectAsync();

            Assert.That(platform.GetCommands(), Is.EqualTo(expected));
            Assert.That(platform.nDisconnects, Is.EqualTo(1));
        }
        public async Task DisconnectRouteAsync()
        {
            byte[][] expected =
            {
                new byte[] { 0x09, 0x02, 0x01, 0x01, 0xff, 0x00, 0x06, 0x00, 0x01 },
                new byte[] { 0x0a, 0x02, 0x09, 0x03, 0x00, 0xfe, 0x06,0x00 },
                new byte[] { 0x0a, 0x03 }
            };

            await metawear.GetModule <ISwitch>().State.AddRouteAsync(source => source.Filter(Comparison.Eq, 1).React(token => debug.DisconnectAsync()));

            Assert.That(platform.nDisconnects, Is.EqualTo(0));
            Assert.That(platform.GetCommands(), Is.EqualTo(expected));
        }