public void WriteToOutputFile()
        {
            MorseDecoder decoder = new MorseDecoder();

            decoder.Decode("../Files/input.txt", "../Files/outputTest.txt");

            FileInfo fileInfo = new FileInfo("../Files/outputTest.txt");

            if (fileInfo.Length > 0)
            {
                Assert.IsFalse(false);
            }
            else
            {
                Assert.IsFalse(true);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter the path to the file with the morse code: ");
            string inputPath = Console.ReadLine();

            Console.WriteLine("Please enter the path to the file into which the decoded text should be written: ");
            string outputPath = Console.ReadLine();

            try {
                MorseDecoder md = new MorseDecoder();
                md.Decode(inputPath, outputPath);
            } catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }

            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
        }
Example #3
0
 public void DecodingASentence()
 {
     Assert.AreEqual("i like steaks a lot", MorseDecoder.Decode("..   .-.. .. -.- .   ... - . .- -.- ...   .-   .-.. --- -"));
 }
Example #4
0
 public void DecodingAWord()
 {
     Assert.AreEqual("steak", MorseDecoder.Decode("... - . .- -.-"));
 }
Example #5
0
 public void DecodingACharacter()
 {
     Assert.AreEqual("e", MorseDecoder.Decode("."));
     Assert.AreEqual("j", MorseDecoder.Decode(".---"));
 }
Example #6
0
 public void DecodeTest2()
 {
     Assert.AreEqual("HELLO WORLD", MorseDecoder.Decode(".... . .-.. .-.. ---   .-- --- .-. .-.. -.."));
 }
Example #7
0
 public void DecodeTest1()
 {
     Assert.AreEqual("HEY JUDE", MorseDecoder.Decode(".... . -.--   .--- ..- -.. ."));
 }