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));
        }
Пример #2
0
        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));
        }