public void TupleCollection2() { var value = new KRPC.Utils.Tuple <uint, string, bool> (1, "jeb", false); const string data = "0a01010a04036a65620a0100"; var encodeResult = Encoder.Encode(value); Assert.AreEqual(data, encodeResult.ToHexString()); var decodeResult = (KRPC.Utils.Tuple <uint, string, bool>)Encoder.Decode(data.ToByteString(), value.GetType()); Assert.AreEqual(value.Item1, decodeResult.Item1); Assert.AreEqual(value.Item2, decodeResult.Item2); Assert.AreEqual(value.Item3, decodeResult.Item3); }
public void TupleCollection2 () { var value = new KRPC.Utils.Tuple<int,string,bool> (1, "jeb", false); const string data = "0a01010a04036a65620a0100"; var encodeResult = Encoder.Encode (value); Assert.AreEqual (data, encodeResult.ToHexString ()); var decodeResult = (KRPC.Utils.Tuple<int,string,bool>)Encoder.Decode (data.ToByteString (), value.GetType ()); Assert.AreEqual (value.Item1, decodeResult.Item1); Assert.AreEqual (value.Item2, decodeResult.Item2); Assert.AreEqual (value.Item3, decodeResult.Item3); }
public void TupleCollection1() { var value = new KRPC.Utils.Tuple <uint> (1); const string data = "0a0101"; var encodeResult = Encoder.Encode(value); Assert.AreEqual(data, encodeResult.ToHexString()); var decodeResult = (KRPC.Utils.Tuple <uint>)Encoder.Decode(data.ToByteString(), value.GetType()); Assert.AreEqual(value.Item1, decodeResult.Item1); }
public void TupleCollection1 () { var value = new KRPC.Utils.Tuple<int> (1); const string data = "0a0101"; var encodeResult = Encoder.Encode (value); Assert.AreEqual (data, encodeResult.ToHexString ()); var decodeResult = (KRPC.Utils.Tuple<int>)Encoder.Decode (data.ToByteString (), value.GetType ()); Assert.AreEqual (value.Item1, decodeResult.Item1); }