Ejemplo n.º 1
0
        public void ToUInt64_UInt64OverloadValueAndLengthInstanceIsNull_ThrowsArgumentNullException()
        {
            IBitCharger instance = null;

            Int32 offset = 42;

            Assert.That(() => instance.ToUInt64(offset), Throws.ArgumentNullException);
        }
Ejemplo n.º 2
0
        public void ToUInt64_OnlyValue_ResultAsExpected()
        {
            IBitCharger instance = this.CreateInstance();

            UInt64 expected = 3026418949640084127; // LE: 0x9FDACE020000002A => 10011111 11011010 11001110 00000010 00000000 00000000 00000000 00101010

            Byte[] array = new Byte[] { 0x9F, 0xDA, 0xCE, 0x02, 0x00, 0x00, 0x00, 0x2A };

            instance.SetBytes(array);

            Assert.That(instance.ToUInt64(), Is.EqualTo(expected));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets all bytes from the charger and converts them into
 /// <see cref="UInt64"/>.
 /// </summary>
 /// <remarks>
 /// This method gets all bytes from the charger and converts
 /// them into <see cref="UInt64"/>.
 /// </remarks>
 /// <param name="charger">
 /// An instance of <see cref="IBitCharger"/> to set the bits
 /// </param>
 /// <returns>
 /// A value of type <see cref="UInt64"/> representing all applied
 /// bits.
 /// </returns>
 public static UInt64 ToUInt64(this IBitCharger charger)
 {
     return(charger.ToUInt64(0));
 }
Ejemplo n.º 4
0
        public void ToUInt64_UInt64OverloadOnlyValueInstanceIsNull_ThrowsArgumentNullException()
        {
            IBitCharger instance = null;

            Assert.That(() => instance.ToUInt64(), Throws.ArgumentNullException);
        }