My code :
public static class TelemetryBuffer
{
public static byte[] ToBuffer(long reading)
{
return BitConverter.GetBytes(reading);
}
public static long FromBuffer(byte[] buffer)
{
return BitConverter.ToInt64(buffer, 0);
}
}```
Return not a single solution, the first one test return:
var bytes = TelemetryBuffer.ToBuffer(Int64.MaxValue);
Assert.Equal(new byte[] { 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f }, bytes);
Assert.Equal() Failure: Collections differ
↓ (pos 0)
Expected: [248, 255, 255, 255, 255, ···]
Actual: [255, 255, 255, 255, 255, ···]
↑ (pos 0)
And I have no idea what is wrong, since the task should be simple because it is introductory exercise