Пример #1
0
        internal async Task TestAllowedMessages(string aDeviceName, VorzeSAProtocol.CommandType aCommandType)
        {
            testUtil = new ProtocolTestUtils();
            await testUtil.SetupTest <VorzeSAProtocol>(aDeviceName);

            if (aCommandType == VorzeSAProtocol.CommandType.Rotate)
            {
                testUtil.TestDeviceAllowedMessages(new Dictionary <System.Type, uint>()
                {
                    { typeof(StopDeviceCmd), 0 },
                    { typeof(VorzeA10CycloneCmd), 0 },
                    { typeof(RotateCmd), 1 },
                });
            }
            else if (aCommandType == VorzeSAProtocol.CommandType.Vibrate)
            {
                testUtil.TestDeviceAllowedMessages(new Dictionary <System.Type, uint>()
                {
                    { typeof(StopDeviceCmd), 0 },
                    { typeof(SingleMotorVibrateCmd), 0 },
                    { typeof(VibrateCmd), 1 },
                });
            }
            else
            {
                Assert.Fail("Unknown command type");
            }
        }
Пример #2
0
        public async Task TestAllowedMessages()
        {
            foreach (var item in KiirooGen21Protocol.DevInfos)
            {
                if (item.Value.VibeCount == 0)
                {
                    continue;
                }

                var testUtil = new ProtocolTestUtils();
                await testUtil.SetupTest <KiirooGen21Protocol>(item.Key);

                var expected = new Dictionary <Type, uint>()
                {
                    { typeof(StopDeviceCmd), 0 },
                    { typeof(SingleMotorVibrateCmd), 0 },
                    { typeof(VibrateCmd), item.Value.VibeCount },
                };

                if (item.Value.HasLinear)
                {
                    expected.Add(typeof(LinearCmd), 1);
                    expected.Add(typeof(FleshlightLaunchFW12Cmd), 0);
                }

                testUtil.TestDeviceAllowedMessages(expected);
            }
        }
Пример #3
0
 public void TestAllowedMessages()
 {
     testUtil.TestDeviceAllowedMessages(new Dictionary <System.Type, uint>()
     {
         { typeof(StopDeviceCmd), 0 },
         { typeof(SingleMotorVibrateCmd), 0 },
         { typeof(VibrateCmd), 1 },
     });
 }
Пример #4
0
 public void TestAllowedMessages()
 {
     testUtil.TestDeviceAllowedMessages(new Dictionary <System.Type, uint>()
     {
         { typeof(StopDeviceCmd), 0 },
         { typeof(FleshlightLaunchFW12Cmd), 0 },
         { typeof(LinearCmd), 1 },
     });
 }
        public async Task TestAllowedMessages()
        {
            foreach (var item in KiirooGen2VibeProtocol.DevInfos)
            {
                var testUtil = new ProtocolTestUtils();
                await testUtil.SetupTest <KiirooGen2VibeProtocol>(item.Key);

                testUtil.TestDeviceAllowedMessages(new Dictionary <Type, uint>()
                {
                    { typeof(StopDeviceCmd), 0 },
                    { typeof(SingleMotorVibrateCmd), 0 },
                    { typeof(VibrateCmd), item.Value.VibeCount },
                });
            }
        }