Пример #1
0
        public void DecodeClass()
        {
            var obj   = new TestService.TestClass("foo");
            var id    = ObjectStore.Instance.AddInstance(obj);
            var value = Encoder.Decode(new [] { (byte)id }.ToHexString().ToByteString(), typeof(TestService.TestClass));

            Assert.AreEqual(obj, value);
        }
Пример #2
0
        public void EncodeClass()
        {
            var obj = new TestService.TestClass("foo");
            var data = Encoder.Encode(obj);
            var expected = new [] { (byte)ObjectStore.Instance.AddInstance(obj) }.ToHexString();

            Assert.AreEqual(expected, data.ToHexString());
        }