Пример #1
0
        //[Test]
        public void GenerateTestCases()
        {
            var random = new Random();

            using (var testData = File.CreateText(PulseEncoderTestCases))
            {
                for (int i = 0; i < 100; i++)
                {
                    var message       = (ushort)random.Next(0xFFFF);
                    var messageString = MessageToString(message);
                    var pulse         = IrPulseEncoder.Encode(message);
                    var pulseString   = GetPulseString(pulse);
                    var line          = string.Format("0x{0:X4};{1};{2}", message, messageString, pulseString);
                    testData.WriteLine(line);
                }
            }
        }
Пример #2
0
 public string RunTestCases(ushort message)
 {
     ushort[] data = IrPulseEncoder.Encode(message);
     return(GetPulseString(data));
 }