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