Ejemplo n.º 1
0
        public void ReadOpenExceptionTest()
        {
            var stubHelper = new StubNativeHelper();
            var stubInfo   = new StubDeviceInfo($"{nameof(ReadOpenExceptionTest)}", 1, 1);
            var mock       = new MockHidDevice(stubInfo, stubHelper);

            stubHelper.IsThrow = true;
            Assert.Catch <DeviceCouldNotOpenedException>(() => mock.ReadOpen());
        }
Ejemplo n.º 2
0
        public void ReadOpenTest()
        {
            var stubHelper = new StubNativeHelper();
            var stubInfo   = new StubDeviceInfo($"{nameof(ReadOpenTest)}", 1, 1);
            var mock       = new MockHidDevice(stubInfo, stubHelper);

            mock.ReadOpen().IsTrue();
            mock.IsReadOpened.IsTrue();
        }