public void Construct2()
        {
            byte[] packetData = TestPacket1;
            byte[] sourcePayloadData = TestPacket1Data;

            Ssm2ReadBlockResponse p = new Ssm2ReadBlockResponse ();
            p.Destination = Ssm2Device.DiagnosticToolF0;
            p.Source = Ssm2Device.Engine10;
            p.Data = TestPacket1Data;

            // should be ok after setting Data
            Assert.AreEqual (packetData.Length, p.Size, "Size before Construct");

            p.Finish ();

            byte[] actual = p.ToBytesCopy ();
            for (int i = 0; i < packetData.Length; i++) {
                Assert.AreEqual (packetData[i], actual[i], "actual[" + i.ToString () + "]");
            }

            Assert.AreEqual (packetData.Length, p.Size, "Size");
            Assert.AreEqual (true, p.Check (), "Check");

            Assert.AreEqual (Ssm2Device.DiagnosticToolF0, p.Destination, "Destination");
            Assert.AreEqual (Ssm2Device.Engine10, p.Source, "Source");
            Assert.AreEqual (Ssm2Command.ReadBlockResponseE0, p.Command, "Command");

            IList<byte> data = p.Data;
            Assert.AreEqual (sourcePayloadData.Length, data.Count, "DataList.Count");
            Assert.AreEqual (sourcePayloadData.Length, p.DataCount, "DataCount");
            for (int i = 0; i < data.Count; i++) {
                Assert.AreEqual (TestPacket1Data[i], data[i], "data[" + i.ToString () + "]");
            }
        }
Beispiel #2
0
        public void NotAllPropertiesSet3()
        {
            Ssm2ReadBlockResponse p = new Ssm2ReadBlockResponse();

            p.Destination = Ssm2Device.Engine10;
            p.Source      = Ssm2Device.DiagnosticToolF0;
            p.Finish();
        }
Beispiel #3
0
        public void NotAllPropertiesSet2()
        {
            Ssm2ReadBlockResponse p = new Ssm2ReadBlockResponse();

            p.Destination = Ssm2Device.Engine10;
            p.Data        = new byte[] { 0, 1, 2, 3, 4, 5 };
            p.Finish();
        }
Beispiel #4
0
        public void NotAllPropertiesSet1()
        {
            Ssm2ReadBlockResponse p = new Ssm2ReadBlockResponse();

            p.Source = Ssm2Device.DiagnosticToolF0;
            p.Data   = new byte[] { 0 };
            p.Finish();
        }
Beispiel #5
0
        public void Construct2()
        {
            byte[] packetData        = TestPacket1;
            byte[] sourcePayloadData = TestPacket1Data;

            Ssm2ReadBlockResponse p = new Ssm2ReadBlockResponse();

            p.Destination = Ssm2Device.DiagnosticToolF0;
            p.Source      = Ssm2Device.Engine10;
            p.Data        = TestPacket1Data;

            // should be ok after setting Data
            Assert.AreEqual(packetData.Length, p.Size, "Size before Construct");

            p.Finish();


            byte[] actual = p.ToBytesCopy();
            for (int i = 0; i < packetData.Length; i++)
            {
                Assert.AreEqual(packetData[i], actual[i], "actual[" + i.ToString() + "]");
            }

            Assert.AreEqual(packetData.Length, p.Size, "Size");
            Assert.AreEqual(true, p.Check(), "Check");

            Assert.AreEqual(Ssm2Device.DiagnosticToolF0, p.Destination, "Destination");
            Assert.AreEqual(Ssm2Device.Engine10, p.Source, "Source");
            Assert.AreEqual(Ssm2Command.ReadBlockResponseE0, p.Command, "Command");

            IList <byte> data = p.Data;

            Assert.AreEqual(sourcePayloadData.Length, data.Count, "DataList.Count");
            Assert.AreEqual(sourcePayloadData.Length, p.DataCount, "DataCount");
            for (int i = 0; i < data.Count; i++)
            {
                Assert.AreEqual(TestPacket1Data[i], data[i], "data[" + i.ToString() + "]");
            }
        }
 public void NotAllPropertiesSet1()
 {
     Ssm2ReadBlockResponse p = new Ssm2ReadBlockResponse ();
     p.Source = Ssm2Device.DiagnosticToolF0;
     p.Data = new byte[] { 0 };
     p.Finish ();
 }
 public void NotAllPropertiesSet3()
 {
     Ssm2ReadBlockResponse p = new Ssm2ReadBlockResponse ();
     p.Destination = Ssm2Device.Engine10;
     p.Source = Ssm2Device.DiagnosticToolF0;
     p.Finish ();
 }
 public void NotAllPropertiesSet2()
 {
     Ssm2ReadBlockResponse p = new Ssm2ReadBlockResponse ();
     p.Destination = Ssm2Device.Engine10;
     p.Data = new byte[] { 0, 1, 2, 3, 4, 5 };
     p.Finish ();
 }