Ejemplo n.º 1
0
        public void MultipleBitsPerDotHandling1()
        {
            //.
            var expected = "E";

            var actual =
                MorseCodeDecoder.DecodeMorse(
                    MorseCodeDecoder.DecodeBits(
                        "111"));

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void TestExampleFromDescription()
        {
            //.... . -.--   .--- ..- -.. .
            var expected = "HEY JUDE";

            var actual =
                MorseCodeDecoder.DecodeMorse(
                    MorseCodeDecoder.DecodeBits(
                        "1100110011001100000011000000111111001100111111001111110000000000000011001111110011111100111111000000110011001111110000001111110011001100000011"));

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void BasicBitsDecoding5()
        {
            //--
            var expected = "M";

            var actual =
                MorseCodeDecoder.DecodeMorse(
                    MorseCodeDecoder.DecodeBits(
                        "1110111"));

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void BasicBitsDecoding3()
        {
            //. .
            var expected = "EE";

            var actual =
                MorseCodeDecoder.DecodeMorse(
                    MorseCodeDecoder.DecodeBits(
                        "10001"));

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 5
0
        public void ExtraZerosHandling4()
        {
            //- .... .   --.- ..- .. -.-. -.-   -... .-. --- .-- -.   ..-. --- -..-   .--- ..- -- .--. ...   --- ...- . .-.   - .... .   .-.. .- --.. -.--   -.. --- --.
            var expected = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.";

            var actual =
                MorseCodeDecoder.DecodeMorse(
                    MorseCodeDecoder.DecodeBits(
                        "11111111111111100000000000000011111000001111100000111110000011111000000000000000111110000000000000000000000000000000000011111111111111100000111111111111111000001111100000111111111111111000000000000000111110000011111000001111111111111110000000000000001111100000111110000000000000001111111111111110000011111000001111111111111110000011111000000000000000111111111111111000001111100000111111111111111000000000000000000000000000000000001111111111111110000011111000001111100000111110000000000000001111100000111111111111111000001111100000000000000011111111111111100000111111111111111000001111111111111110000000000000001111100000111111111111111000001111111111111110000000000000001111111111111110000011111000000000000000000000000000000000001111100000111110000011111111111111100000111110000000000000001111111111111110000011111111111111100000111111111111111000000000000000111111111111111000001111100000111110000011111111111111100000000000000000000000000000000000111110000011111111111111100000111111111111111000001111111111111110000000000000001111100000111110000011111111111111100000000000000011111111111111100000111111111111111000000000000000111110000011111111111111100000111111111111111000001111100000000000000011111000001111100000111110000000000000000000000000000000000011111111111111100000111111111111111000001111111111111110000000000000001111100000111110000011111000001111111111111110000000000000001111100000000000000011111000001111111111111110000011111000000000000000000000000000000000001111111111111110000000000000001111100000111110000011111000001111100000000000000011111000000000000000000000000000000000001111100000111111111111111000001111100000111110000000000000001111100000111111111111111000000000000000111111111111111000001111111111111110000011111000001111100000000000000011111111111111100000111110000011111111111111100000111111111111111000000000000000000000000000000000001111111111111110000011111000001111100000000000000011111111111111100000111111111111111000001111111111111110000000000000001111111111111110000011111111111111100000111110000000000000001111100000111111111111111000001111100000111111111111111000001111100000111111111111111"));

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 6
0
        public void ExtraZerosHandling2()
        {
            //.
            var expected = "E";

            var actual =
                MorseCodeDecoder.DecodeMorse(
                    MorseCodeDecoder.DecodeBits(
                        "000000011100000"));

            Assert.AreEqual(expected, actual);
        }