public void IOIOProtocolOutgoing_CheckInterfaceVersionWrites() { this.CreateCaptureLogHandlerSet(); MemoryStream fakeStream = new MemoryStream(); IOIOProtocolOutgoing fooOut = new IOIOProtocolOutgoing(fakeStream); fooOut.checkInterfaceVersion(); Assert.AreEqual(9, fakeStream.Length, "expected to send 8 characters when checking interface version"); // could seek to 0 and read the byte from the buffer but this is easier byte[] streamBuffer = fakeStream.ToArray(); Assert.AreEqual((int)IOIOProtocolCommands.CHECK_INTERFACE, streamBuffer[0]); }
public void IOIOProtocolOutgoing_CheckInterfaceVersion() { IOIOConnection ourConn = this.CreateGoodSerialConnection(); this.CreateCaptureLogHandlerSet(); LOG.Debug("Setup Complete"); IOIOProtocolIncoming fooIn = new IOIOProtocolIncoming(ourConn.GetInputStream(), HandlerObservable_); IOIOProtocolOutgoing fooOut = new IOIOProtocolOutgoing(ourConn.GetOutputStream()); System.Threading.Thread.Sleep(100); // wait for us to get the hardware ids fooOut.checkInterfaceVersion(); // wait for reply System.Threading.Thread.Sleep(2000); Assert.IsTrue(CapturedConnectionState_.Supported_.IsSupported, " the HandlerContainer_ returned not supported interface."); }