public void get_msb_bit_test() { const byte msbIndex = 15; const ushort value = 1 << msbIndex; Assert.AreEqual(true, UshortUtils.GetBit(value, msbIndex)); }
public void get_lsb_bit_test() { const byte lsbIndex = 0; const ushort value = 1 << lsbIndex; Assert.AreEqual(true, UshortUtils.GetBit(value, lsbIndex)); }
public void get_bit_out_of_range_test() { Assert.Throws <IndexOutOfRangeException>(() => UshortUtils.GetBit(0x10, 16)); }