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); }
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()); }