コード例 #1
0
        public void get_msb_test()
        {
            const byte msbIndex = 7;
            const byte value    = 1 << msbIndex;

            Assert.IsTrue(ByteUtils.GetBit(value, msbIndex));
        }
コード例 #2
0
        public void get_lsb_test()
        {
            const byte lsbIndex = 0;
            const byte value    = 1 << lsbIndex;

            Assert.IsTrue(ByteUtils.GetBit(value, lsbIndex));
        }
コード例 #3
0
 public void get_bit_out_of_range_test()
 {
     Assert.Throws <IndexOutOfRangeException>(() =>
                                              ByteUtils.GetBit(0x10, 8));
 }