예제 #1
0
        public void WriteOpDeletion()
        {
            var writeOp = new WriteOpLCS
            {
                WriteOpType = WriteOpType.Deletion
            };
            var actual   = LCSCore.LCSDeserialization(writeOp).ByteArrayToString();
            var expected = "00000000".ToLower();

            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void WriteOpValue()
        {
            var writeOp = new WriteOpLCS
            {
                WriteOpType = WriteOpType.Value,
                Value       = "cafed00d".FromHexToBytes()
            };
            var actual   = LCSCore.LCSDeserialization(writeOp).ByteArrayToString();
            var expected = "0100000004000000CAFED00D".ToLower();

            Assert.Equal(expected, actual);
        }
예제 #3
0
        public WriteOpLCS GetWriteOp(byte[] source, ref int cursor)
        {
            var retVal = new WriteOpLCS();

            retVal.WriteOpType = source.LCSerialization <uint>(ref cursor);

            if (retVal.WriteOpTypeEnum == Enum.EWriteOpLCS.Value)
            {
                retVal.Value = source.LCSerialization <byte[]>(ref cursor);
            }

            return(retVal);
        }