示例#1
0
        public void BitArrayToByteArray_Multiple()
        {
            byte[]   expected = { 0x4B, 0x58, 0x07 };
            BitArray testBits = new BitArray(StringToArrayOfBits("1101 0010 0001 1010 111"));

            byte[] actual = BitArrayExtender.ToByteArray(testBits);
            CollectionAssert.AreEqual(expected, actual);
        }
示例#2
0
        public void BitArrayToByteArray_One()
        {
            byte[]   expected = { 10 };
            BitArray testBits = new BitArray(StringToArrayOfBits("0101 0000"));

            byte[] actual = BitArrayExtender.ToByteArray(testBits);
            CollectionAssert.AreEqual(expected, actual);
        }