Ejemplo n.º 1
0
 public void Throws_when_not_enough_space_in_array2()
 {
     byte[] outBytes = new byte[1];
     Assert.Throws <ArgumentException>(() => Dpt9.DoubleToBytes(0d, outBytes, 0));
 }
Ejemplo n.º 2
0
 public void Throws_when_input_float_is_too_big2()
 {
     byte[] outBytes = new byte[10];
     Assert.Throws <ArgumentOutOfRangeException>(() => Dpt9.DoubleToBytes(1000000000d, outBytes, 0));
 }
Ejemplo n.º 3
0
 public void DoubleToBytes(byte[] input, double expected)
 {
     byte[] outBytes = new byte[5];
     Dpt9.DoubleToBytes(expected, outBytes, 3);
     Assert.Equal(input, outBytes.Skip(3).ToArray());
 }