public void ToBuffer_upper_neg_int() { int n = Int16.MinValue - 1; var bytes = TelemetryBuffer.ToBuffer(n); Assert.Equal(new byte[] { 0xfc, 0xff, 0x7f, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0 }, bytes); }
public void ToBuffer_lower_neg_short() { var bytes = TelemetryBuffer.ToBuffer(Int16.MinValue); Assert.Equal(new byte[] { 0xfe, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, bytes); }
public void ToBuffer_upper_neg_short() { var bytes = TelemetryBuffer.ToBuffer(-1); Assert.Equal(new byte[] { 0xfe, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, bytes); }
public void ToBuffer_Zero() { var bytes = TelemetryBuffer.ToBuffer(0); Assert.Equal(new byte[] { 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, bytes); }
public void ToBuffer_upper_long() { var bytes = TelemetryBuffer.ToBuffer(Int64.MaxValue); Assert.Equal(new byte[] { 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f }, bytes); }
public void ToBuffer_upper_short() { var bytes = TelemetryBuffer.ToBuffer(Int16.MaxValue); Assert.Equal(new byte[] { 0xfe, 0xff, 0x7f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, bytes); }
public void ToBuffer_lower_ushort() { var bytes = TelemetryBuffer.ToBuffer((long)Int16.MaxValue + 1); Assert.Equal(new byte[] { 0x2, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, bytes); }
public void ToBuffer_lower_int() { var bytes = TelemetryBuffer.ToBuffer((long)UInt16.MaxValue + 1); Assert.Equal(new byte[] { 0xfc, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0 }, bytes); }
public void ToBuffer_upper_uint() { var bytes = TelemetryBuffer.ToBuffer(UInt32.MaxValue); Assert.Equal(new byte[] { 0x4, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0 }, bytes); }
public void ToBuffer_lower_neg_long() { var bytes = TelemetryBuffer.ToBuffer(Int64.MinValue); Assert.Equal(new byte[] { 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80 }, bytes); }
public void ToBuffer_upper_neg_long() { var bytes = TelemetryBuffer.ToBuffer((long)Int32.MinValue - 1); Assert.Equal(new byte[] { 0xf8, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff }, bytes); }