示例#1
0
        public void Writes_Two_Byte_Integer()
        {
            var expectedResult = new byte[] {
                0x26, 0x94
            };
            var builder = new PduWriter();

            short testValue = 9876;
            builder.WriteShort(testValue);
            var buffer = builder.GetBytes();

            CollectionAssert.AreEqual(expectedResult, buffer);
        }
示例#2
0
        public void Appends_Two_Byte_Integer()
        {
            var expectedResult = new byte[] {
                0x07, 0x28,
                0x00, 0x01, 0x36, 0x16
            };
            var builder = new PduWriter();

            short testValue = 1832;
            builder.WriteShort(testValue);
            builder.WriteInteger(79382);
            var buffer = builder.GetBytes();

            CollectionAssert.AreEqual(expectedResult, buffer);
        }
示例#3
0
        public void Resizes_Buffer_On_Write_Two_Byte_Integer()
        {
            var expectedResult = new byte[] {
                0x07, 0x28
            };
            var builder = new PduWriter(0);
            short testValue = 1832;
            builder.WriteShort(testValue);
            var buffer = builder.GetBytes();

            CollectionAssert.AreEqual(expectedResult, buffer);
        }