Exemplo n.º 1
0
 public static void Test_IsUnique()
 {
     Console.WriteLine("checking if strings are unique");
     Console.WriteLine("abc " + StringsAndArrays.isUnique("abc".ToCharArray()));
     Console.WriteLine("[emptystring] " + StringsAndArrays.isUnique("".ToCharArray()));
     Console.WriteLine("aabc " + StringsAndArrays.isUnique("aabc".ToCharArray()));
     Console.WriteLine("c " + StringsAndArrays.isUnique("c".ToCharArray()));
     Console.WriteLine("[null value] " + StringsAndArrays.isUnique(null));
 }
Exemplo n.º 2
0
        public static void SimpleCompress_Test()
        {
            Console.WriteLine("Starting simple compression test.");
            string[] testData = { "", "a", "aaAA", "aaabbbCCCabc", "ab", "XXXXXXXXXX" };

            foreach (string input in testData)
            {
                Console.WriteLine(String.Format("input: {0}, output: {1}", input, StringsAndArrays.SimpleCompress(input)));
            }
        }