public void get_msb_test() { const byte msbIndex = 7; const byte value = 1 << msbIndex; Assert.IsTrue(ByteUtils.GetBit(value, msbIndex)); }
public void get_lsb_test() { const byte lsbIndex = 0; const byte value = 1 << lsbIndex; Assert.IsTrue(ByteUtils.GetBit(value, lsbIndex)); }
public void get_bit_out_of_range_test() { Assert.Throws <IndexOutOfRangeException>(() => ByteUtils.GetBit(0x10, 8)); }