Beispiel #1
0
        public void Test_BitFlagHelperTests_SetBit()
        {
            byte value = 0;

            BitFlagHelper.SetBit(ref value, 0, false);
            Assert.True(BitFlagHelper.IsBitOff(value, 0), "IsBitOff() for 0 bit returned false (it should be true)");

            BitFlagHelper.SetBit(ref value, 0, true);
            Assert.True(BitFlagHelper.IsBitOn(value, 0), "IsBitOn() for 0 bit returned false (it should be true)");
        }
Beispiel #2
0
        public void Test_BitFlagHelperTests_IsBitOff()
        {
            byte value = 0;

            Assert.True(BitFlagHelper.IsBitOff(value, 0), "IsBitOff() for 0 bit returned true (it should be false)");

            byte value2 = 1;

            Assert.False(BitFlagHelper.IsBitOff(value2, 0), "IsBitOff() for 0 bit returned true (it should be true)");
        }