public PortManager(PortLayout portLayout, ILogger logger, int latchDelayOffset)
        {
            _portLayout = portLayout;
            _logger = logger;
            _latchDelayOffset = latchDelayOffset;
            _iNumBanks = 0;

            Initalize();
        }
        public void DifferentlySizedPortAndPacketArraysThrowsException()
        {
            var genericPinMock = new Mock<IOutputPort>();
            var bankZeroMock = new Mock<IOutputPort>();

            var layout = new PortLayout { LatchPort = genericPinMock.Object, ClockPort = genericPinMock.Object, DataPorts = new[] { bankZeroMock.Object } };
            var loggerMock = new Mock<ILogger>();
            var portManager = new PortManager(layout, loggerMock.Object);

            portManager.SendPacketArray(new[] { new CommandPacket(), new CommandPacket(), new CommandPacket() });
        }
        public void CreatingPortManagerPullsLatchPortLow()
        {
            var latchMock = new Mock<IOutputPort>(MockBehavior.Strict);
            latchMock.Setup(test => test.Write(false));

            var layout = new PortLayout {LatchPort = latchMock.Object};
            var loggerMock = new Mock<ILogger>();

            var portManager = new PortManager(layout, loggerMock.Object);

            latchMock.VerifyAll();
        }
 public PortManager(PortLayout portLayout, ILogger logger)
     : this(portLayout, logger, 0)
 {
 }
        public void LatchPullsLatchOutputHighAndLow()
        {
            var latchMock = new Mock<IOutputPort>(MockBehavior.Strict);
            latchMock.Setup(test => test.Write(true));
            latchMock.Setup(test => test.Write(false));

            var layout = new PortLayout { LatchPort = latchMock.Object };
            var loggerMock = new Mock<ILogger>();

            var portManager = new PortManager(layout, loggerMock.Object);

            portManager.Latch();
        }