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);
            }
        }
예제 #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();
        }
예제 #3
0
 public void DecodingASentence()
 {
     Assert.AreEqual("i like steaks a lot", MorseDecoder.Decode("..   .-.. .. -.- .   ... - . .- -.- ...   .-   .-.. --- -"));
 }
예제 #4
0
 public void DecodingAWord()
 {
     Assert.AreEqual("steak", MorseDecoder.Decode("... - . .- -.-"));
 }
예제 #5
0
 public void DecodingACharacter()
 {
     Assert.AreEqual("e", MorseDecoder.Decode("."));
     Assert.AreEqual("j", MorseDecoder.Decode(".---"));
 }
예제 #6
0
 public void DecodeTest2()
 {
     Assert.AreEqual("HELLO WORLD", MorseDecoder.Decode(".... . .-.. .-.. ---   .-- --- .-. .-.. -.."));
 }
예제 #7
0
 public void DecodeTest1()
 {
     Assert.AreEqual("HEY JUDE", MorseDecoder.Decode(".... . -.--   .--- ..- -.. ."));
 }