public void ToInt64_Int64OverloadValueAndLengthInstanceIsNull_ThrowsArgumentNullException() { IBitCharger instance = null; Int32 offset = 42; Assert.That(() => instance.ToInt64(offset), Throws.ArgumentNullException); }
public void ToInt64_OnlyValue_ResultAsExpected() { IBitCharger instance = this.CreateInstance(); Int64 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.ToInt64(), Is.EqualTo(expected)); }
/// <summary> /// Gets all bytes from the charger and converts them into /// <see cref="Int64"/>. /// </summary> /// <remarks> /// This method gets all bytes from the charger and converts /// them into <see cref="Int64"/>. /// </remarks> /// <param name="charger"> /// An instance of <see cref="IBitCharger"/> to set the bits /// </param> /// <returns> /// A value of type <see cref="Int64"/> representing all applied /// bits. /// </returns> public static Int64 ToInt64(this IBitCharger charger) { return(charger.ToInt64(0)); }
public void ToInt64_Int64OverloadOnlyValueInstanceIsNull_ThrowsArgumentNullException() { IBitCharger instance = null; Assert.That(() => instance.ToInt64(), Throws.ArgumentNullException); }