コード例 #1
0
        public void EncodeAsciiCharackter()
        {
            const char charackter = 'A';

            var datapointType = new DptCharackterAscii(charackter);

            Assert.AreEqual(0x41, datapointType.Payload[0]);

            var datapointType2 = new DptCharackterAscii(datapointType.Payload);

            Assert.AreEqual('A', datapointType2.Value);
        }
コード例 #2
0
        public void EncodeAndDecodeAsciiCharackters()
        {
            for (int i = 0; i < 127; i++)
            {
                var charackter = ((char)i);

                var dpt1 = new DptCharackterAscii(charackter);
                var dpt2 = new DptCharackterAscii(dpt1.Payload);

                Assert.AreEqual(dpt2.Value, charackter);
            }
        }