public void UpdateImagesTestNullData()
        {
            var simSystem = new StubPLCSim()
            {
                ReadOutputImageInt32Int32ImageDataTypeConstantsObjectRef =
                    (int a, int b, ImageDataTypeConstants c, ref object pData) =>
                {
                    pData = null;
                }
            };
            var target = new SimulatedPLC(simSystem);

            simSystem.Connect();
            target.OutputImageOffestRequest(5);
            try
            {
                target.UpdateImages();
            }
            catch (Exception e)
            {
                Assert.Fail("Exception thrown by UpdateImages call\n" + e.ToString());
            }
            finally
            {
                simSystem.Disconnect();
            }


            //Assert.Fail("Exception not found");
        }
        public void OutputImageOffestRequestTest()
        {
            var target = new SimulatedPLC(); // TODO: Initialize to an appropriate value
            int offset = 50;                 // TODO: Initialize to an appropriate value

            target.OutputImageOffestRequest(offset);
            Assert.IsTrue(offset <= target.OutputImageBuffer.Capacity);
        }
        public void UpdateImagesTest()
        {
            var testData  = new Byte[] { 1, 2, 3, 4, 5 };
            var simSystem = new PLCSimConnector.Fakes.StubPLCSim()
            {
                ReadOutputImageInt32Int32ImageDataTypeConstantsObjectRef =
                    (int a, int b, ImageDataTypeConstants c, ref object pData) =>
                {
                    pData = testData;
                }
            };
            var target = new SimulatedPLC(simSystem);

            simSystem.Connect();
            target.OutputImageOffestRequest(5);
            target.UpdateImages();
            simSystem.Disconnect();

            Assert.IsTrue(target.OutputImageBuffer.GetBuffer().SequenceEqual(testData));
        }