Example #1
0
        public void UnexpectedCode_Test(byte errorCode)
        {
            SetupWrite(ftdiMock, new byte[] { 0xaa, 0x01, 0x01 });
            SetupRead(ftdiMock, new byte[] { errorCode });

            var sut    = new QueryDeviceCommand();
            var result = sut.Execute(ftdiMock.Object);

            result.Should().Be(null);
        }
Example #2
0
        public void Successful_BootMode_Scenario_Test()
        {
            SetupWrite(ftdiMock, new byte[] { 0xaa, 0x01, 0x01 });
            SetupRead(ftdiMock, new byte[] { 0x55, 0x03, 0x01, 0x80, 0x01 });

            var sut    = new QueryDeviceCommand();
            var result = sut.Execute(ftdiMock.Object);

            result.Success.Should().BeTrue();
            result.IsBootMode.Should().BeTrue();
        }