Exemplo n.º 1
0
        public void TestEncodeTillDot()
        {
            INameEncoder ne = new NameEncoder();
            const string test_string = "Test строка.OK";
            string encoded_string = ne.Encode(test_string);
            string decoded_string = ne.Decode(encoded_string);

            Console.WriteLine("test:'{0}', encoded:'{1}', decoded:'{2}'",
                test_string, encoded_string, decoded_string);

            Assert.AreEqual(encoded_string.Split('.')[1], "OK", false);
            Assert.AreEqual(test_string, decoded_string, false);
        }
Exemplo n.º 2
0
        public void TestLatinName()
        {
            INameEncoder ne = new NameEncoder();
            const string test_string = "Test string";
            string encoded_string = ne.Encode(test_string);
            string decoded_string = ne.Decode(encoded_string);

            Console.WriteLine("test:'{0}', encoded:'{1}', decoded:'{2}'",
                test_string, encoded_string, decoded_string);

            Assert.AreNotEqual(test_string, encoded_string);
            Assert.AreNotEqual(encoded_string,decoded_string);
            Assert.AreEqual(test_string, decoded_string, false);
        }