public void ReadNullableGuid_Random() { var value = Guid.NewGuid(); var encoder = new ClassicDecoder(new Buffer <Byte>(new Byte[] { 17, 0, 1 }.Concat(value.ToByteArray()).ToArray())); Assert.AreEqual(value, encoder.ReadNullableGuid()); }
public void ReadNullableIPAddress_Test() { var encoder = new ClassicDecoder(StringToBuffer("05-00-04-01-02-03-04")); Assert.AreEqual("1.2.3.4", encoder.ReadNullableIPAddress().ToString()); }
public void ReadNullableDateTimeSimple_Nullable() { var encoder = new ClassicDecoder(StringToBuffer("01-00-00")); Assert.AreEqual(null, encoder.ReadNullableDateTimeSimple()); }
public void ReadNullableDateTimeSimple_1() { var encoder = new ClassicDecoder(StringToBuffer("09-00-01-01-00-00-00-00-00-00-00")); Assert.AreEqual(DateUtility.Epoch.AddSeconds(1), encoder.ReadNullableDateTimeSimple()); }
public void ReadNullableDateTime_1() { var encoder = new ClassicDecoder(StringToBuffer("09-00-01-01-00-00-00-00-00-00-00")); Assert.AreEqual(new DateTime(1), encoder.ReadNullableDateTime()); }
public void ReadNullableUInt32_1() { var encoder = new ClassicDecoder(StringToBuffer("05-00-01-01-00-00-00")); Assert.AreEqual((UInt32)1, encoder.ReadNullableUInt32()); }
public void ReadNullableUInt16_Null() { var encoder = new ClassicDecoder(StringToBuffer("01-00-00")); Assert.AreEqual(null, encoder.ReadNullableUInt16()); }
public void ReadSInt8_Minus1() { var encoder = new ClassicDecoder(StringToBuffer("01-00-FF")); Assert.AreEqual(-1, encoder.ReadSInt8()); }
public void ReadBoolean_False() { var encoder = new ClassicDecoder(StringToBuffer("01-00-00")); Assert.AreEqual(false, encoder.ReadBoolean()); }
public void ReadBoolean_True() { var encoder = new ClassicDecoder(StringToBuffer("01-00-FF")); Assert.AreEqual(true, encoder.ReadBoolean()); }
public void ReadNullableDouble_1() { var encoder = new ClassicDecoder(StringToBuffer("09-00-01-00-00-00-00-00-00-F0-3F")); Assert.AreEqual(1, encoder.ReadNullableDouble()); }
public void ReadNullableFloat_1() { var encoder = new ClassicDecoder(StringToBuffer("05-00-01-00-00-80-3F")); Assert.AreEqual(1, encoder.ReadNullableFloat()); }
public void ReadNullableSInt64_1() { var encoder = new ClassicDecoder(StringToBuffer("09-00-01-01-00-00-00-00-00-00-00")); Assert.AreEqual(1, encoder.ReadNullableSInt64()); }
public void ReadUInt8_1() { var encoder = new ClassicDecoder(StringToBuffer("01-00-01")); Assert.AreEqual(1, encoder.ReadUInt8()); }
public void ReadUInt64_1() { var encoder = new ClassicDecoder(StringToBuffer("08-00-01-00-00-00-00-00-00-00")); Assert.AreEqual((UInt64)1, encoder.ReadUInt64()); }
public void ReadNullableString_Test() { var encoder = new ClassicDecoder(StringToBuffer("07-00-01-04-00-74-65-73-74")); Assert.AreEqual("test", encoder.ReadNullableString()); }
public void Read_Raw() { var encoder = new ClassicDecoder(StringToBuffer("03-00-01-02-03")); Assert.AreEqual("01-02-03", BitConverter.ToString(encoder.Read(3))); }
public void ReadTime_1() { var encoder = new ClassicDecoder(StringToBuffer("08-00-01-00-00-00-00-00-00-00")); Assert.AreEqual(new TimeSpan(1), encoder.ReadTime()); }
public void ReadNullableSInt8_1() { var encoder = new ClassicDecoder(StringToBuffer("02-00-01-01")); Assert.AreEqual((SByte)1, encoder.ReadNullableSInt8()); }
public void ReadNullableTimeSimple_1() { var encoder = new ClassicDecoder(StringToBuffer("09-00-01-01-00-00-00-00-00-00-00")); Assert.AreEqual(new TimeSpan(0, 0, 1), encoder.ReadNullableTimeSimple()); }
public void ReadSInt16_1() { var encoder = new ClassicDecoder(StringToBuffer("02-00-01-00")); Assert.AreEqual(1, encoder.ReadSInt16()); }
public void ReadNullableSInt16_1() { var encoder = new ClassicDecoder(StringToBuffer("03-00-01-01-00")); Assert.AreEqual((Int16)1, encoder.ReadNullableSInt16()); }