コード例 #1
0
        public void get_msb_bit_test()
        {
            const byte   msbIndex = 15;
            const ushort value    = 1 << msbIndex;

            Assert.AreEqual(true, UshortUtils.GetBit(value, msbIndex));
        }
コード例 #2
0
        public void get_lsb_bit_test()
        {
            const byte   lsbIndex = 0;
            const ushort value    = 1 << lsbIndex;

            Assert.AreEqual(true, UshortUtils.GetBit(value, lsbIndex));
        }
コード例 #3
0
 public void get_bit_out_of_range_test()
 {
     Assert.Throws <IndexOutOfRangeException>(() =>
                                              UshortUtils.GetBit(0x10, 16));
 }