예제 #1
0
        public void Flag_Byte(int position, int expected)
        {
            byte number  = 0x13;
            var  flagged = Bits.Byte.Flag(number, position);

            BitsAssert.AreEqual((byte)expected, flagged);
        }
예제 #2
0
        public void Flag_UInt32(int position, int expected)
        {
            var number  = 0x13U;
            var flagged = Bits.UInt32.Flag(number, position);

            BitsAssert.AreEqual((uint)expected, flagged);
        }
예제 #3
0
        public void Unflag_UInt64(int position, int expected)
        {
            var number  = 0xFCUL;
            var flagged = Bits.UInt64.Unflag(number, position);

            BitsAssert.AreEqual((ulong)expected, flagged);
        }
예제 #4
0
        public void Parse(string pattern, int expected)
        {
            var bits = Bits.UInt32.Parse(pattern);

            BitsAssert.AreEqual((ulong)expected, bits);
        }
예제 #5
0
        public void Mirror_UInt64(long bits, long expected)
        {
            var actual = Bits.UInt64.Mirror((ulong)bits);

            BitsAssert.AreEqual((ulong)expected, actual);
        }
예제 #6
0
        public void Mirror_UInt32(long bits, long expected)
        {
            var actual = Bits.UInt32.Mirror((uint)bits);

            BitsAssert.AreEqual((uint)expected, actual);
        }
예제 #7
0
        public void Mirror_Byte(byte bits, byte expected)
        {
            var actual = Bits.Byte.Mirror(bits);

            BitsAssert.AreEqual(expected, actual);
        }