Esempio n. 1
0
        public void TestEncode()
        {
            Encoder enc      = new Encoder("hello world");
            string  result   = enc.Encode();
            string  expected = "00000110101100100111101110101111";

            Assert.AreEqual(expected, result);
        }
Esempio n. 2
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);
        }
Esempio n. 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);
        }
Esempio n. 4
0
        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());
        }
Esempio n. 5
0
 public void TestEncode5()
 {
     Encoder enc    = new Encoder("a");
     string  result = enc.Encode();
 }
Esempio n. 6
0
 public void TestEncode4()
 {
     Encoder enc    = new Encoder("skdajfksfdaksldfjdslkafjlkdsajflkdsajflkdsajflkdsajffdsjslkfdjslkaf");
     string  result = enc.Encode();
 }