Пример #1
0
        public void CalculateControlBits()
        {
            var coder = new HammingCoder(new BaseCoder());
            var res   = coder.CalculateControlBits("00100010001011100001", coder.CalculateControlLines("00100010001011100001"));

            Assert.AreEqual(true, res[0]);
            Assert.AreEqual(true, res[1]);
            Assert.AreEqual(false, res[3]);
        }
Пример #2
0
        public void GetControlLines()
        {
            var coder = new HammingCoder(new BaseCoder());
            var res   = coder.CalculateControlLines("00100010001011100001");

            Assert.AreEqual("10101010101010101010", res[0]);
            Assert.AreEqual("01100110011001100110", res[1]);
            Assert.AreEqual("00000000000000011111", res[4]);
        }