コード例 #1
0
        public void TestDecode3()
        {
            Encoder enc = new Encoder("\n \n \n");

            enc.Encode();
            string result   = enc.Decode();
            string expected = "\n \n \n";

            Assert.AreEqual(expected, result);
        }
コード例 #2
0
        public void TestDecode()
        {
            Encoder enc = new Encoder("hello world");

            enc.Encode();
            string result   = enc.Decode();
            string expected = "hello world";

            Assert.AreEqual(expected, result);
        }
コード例 #3
0
        public void TestDecode2()
        {
            Encoder enc = new Encoder("Old Macdonald had a farm");

            enc.Encode();
            string result   = enc.Decode();
            string expected = "Old Macdonald had a farm";

            Assert.AreEqual(expected, result);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: ariellelynch/Assn3
        public static void Main(string[] args)
        {
            Console.Write("Enter a string to be encoded: ");
            var     inputString = Console.ReadLine();
            Encoder newEncoder  = new Encoder(inputString);

            Console.Write("Encoded string: ");
            Console.WriteLine(newEncoder.Encode());
            Console.Write("The decoded text was: ");
            Console.WriteLine(newEncoder.Decode());
        }