Пример #1
0
 static void Main(string[] args)
 {
     // for (int i = 'A'; i <= 'Z'; i++)
     // {
     //     System.Console.WriteLine(@"{"",'" + (char)i + @"'},");
     // }
     Console.WriteLine(MorseCodeDecoder.Decode("...---... -.-.--   - .... .   --.- ..- .. -.-. -.-   -... .-. --- .-- -.   ..-. --- -..-   .--- ..- -- .--. ...   --- ...- . .-.   - .... .   .-.. .- --.. -.--   -.. --- --. .-.-.- "));
 }
Пример #2
0
        public void Decode_RegularString_CorrectResult()
        {
            string input    = ".... . -.--   .--- ..- -.. .";
            string expected = "HEY JUDE";

            string actual = MorseCodeDecoder.Decode(input);

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void Test1()
        {
            string input    = ".... . -.--   .--- ..- -.. .";
            string expected = "[L][L][L] [L][L][L][L]";

            string actual = MorseCodeDecoder.Decode(input);

            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void MorseCodeDecoderBasicTest_1()
        {
            try
            {
                string input    = ".... . -.--   .--- ..- -.. .";
                string expected = "HEY JUDE";

                string actual = MorseCodeDecoder.Decode(input);

                Assert.AreEqual(expected, actual);
            }
            catch (Exception ex)
            {
                Assert.Fail("There seems to be an error somewhere in your code. Exception message reads as follows: " + ex.Message);
            }
        }
Пример #5
0
    public void MorseCodeDecoderComplexTest_3()
    {
        try
        {
            string input =
                "      ...---... -.-.--   - .... .   --.- ..- .. -.-. -.-   -... .-. --- .-- -.   ..-. --- -..-   .--- ..- -- .--. ...   --- ...- . .-.   - .... .   .-.. .- --.. -.--   -.. --- --. .-.-.-  ";
            string expected = "SOS! THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.";

            string actual = MorseCodeDecoder.Decode(input);

            Assert.AreEqual(expected, actual);
        }
        catch (Exception ex)
        {
            Assert.Fail("There seems to be an error somewhere in your code. Exception message reads as follows: " +
                        ex.Message);
        }
    }
Пример #6
0
 static void Main(string[] args)
 {
     Console.WriteLine(MorseCodeDecoder.Decode("...---..."));
 }
Пример #7
0
 public void MorseCodeTest()
 {
     Assert.AreEqual("HEY JUDE", MorseCodeDecoder.Decode(".... . -.--   .--- ..- -.. ."));
 }
Пример #8
0
        public void Decode_SOSCodeTester(string input, string expected)
        {
            var actual = MorseCodeDecoder.Decode(input);

            Assert.AreEqual(expected, actual);
        }
Пример #9
0
 public void OriginalTest()
 {
     _test.Decode(".... . -.--   .--- ..- -.. .").ShouldBe("HEY JUDE");
 }