Example #1
0
        private static void testHighLevelEncodeString(String s, int expectedReceivedBits)
        {
            BitArray bits             = new HighLevelEncoder(LATIN_1.GetBytes(s)).encode();
            int      receivedBitCount = stripSpace(bits.ToString()).Length;

            Assert.AreEqual(expectedReceivedBits, receivedBitCount, "highLevelEncode() failed for input string: " + s);
            Assert.AreEqual(s, Internal.Decoder.highLevelDecode(toBooleanArray(bits)));
        }
Example #2
0
        private static void testHighLevelEncodeString(String s, String expectedBits)
        {
            BitArray bits         = new HighLevelEncoder(LATIN_1.GetBytes(s)).encode();
            String   receivedBits = bits.ToString().Replace(" ", "");

            Assert.AreEqual(expectedBits.Replace(" ", ""), receivedBits, "highLevelEncode() failed for input string: " + s);
            Assert.AreEqual(s, Internal.Decoder.highLevelDecode(toBooleanArray(bits)));
        }