Beispiel #1
0
        /// <summary>
        /// Reads a value from the packet
        /// </summary>
        /// <returns>value</returns>
        public double ReadDouble()
        {
            double res = ByteManipulator.ReadDouble(Data, CurrentSeek);

            CurrentSeek += sizeof(double);
            return(res);
        }
Beispiel #2
0
    public void TestListDoubleReadRedLight()
    {
        List <byte> arr = new List <byte>(sizeof(double));

        for (int i = 0; i < sizeof(double); i++)
        {
            arr.Add(0);
        }
        ByteManipulator.Write(arr, 0, 10d);
        Assert.That(ByteManipulator.ReadDouble(arr, 0), Is.Not.EqualTo(9d));
    }
Beispiel #3
0
 public void TestDoubleReadRedLight()
 {
     byte[] arr = new byte[sizeof(double)];
     ByteManipulator.Write(arr, 0, 1000000d);
     Assert.That(ByteManipulator.ReadDouble(arr, 0), Is.Not.EqualTo(0d));
 }
Beispiel #4
0
 public void TestDoubleRead()
 {
     byte[] arr = new byte[sizeof(double)];
     ByteManipulator.Write(arr, 0, 1000.251d);
     Assert.That(ByteManipulator.ReadDouble(arr, 0), Is.EqualTo(1000.251d));
 }