예제 #1
0
        public void EmptyString()
        {
            List <string> perms = DistinctPerms.GetPerms(string.Empty);

            Assert.AreEqual(1, perms.Count);
            Assert.AreEqual(string.Empty, perms[0]);
        }
예제 #2
0
        public void StringLengthFiveDups()
        {
            string           s     = "aabbc";
            List <string>    perms = DistinctPerms.GetPerms(s);
            HashSet <string> set   = new HashSet <string>(perms);

            Assert.AreEqual(set.Count, perms.Count);
        }
예제 #3
0
        public void StringMoon()
        {
            string           s     = "moon";
            List <string>    perms = DistinctPerms.GetPerms(s);
            HashSet <string> set   = new HashSet <string>(perms);

            Assert.AreEqual(set.Count, perms.Count);
            Assert.AreEqual(set.Count, 12);
        }
예제 #4
0
        public void StringRadar()
        {
            string           s     = "radar";
            List <string>    perms = DistinctPerms.GetPerms(s);
            HashSet <string> set   = new HashSet <string>(perms);

            Assert.AreEqual(set.Count, perms.Count);
            Assert.AreEqual(set.Count, 30);
        }
예제 #5
0
        public void SingletonString()
        {
            string        singleton = "a";
            List <string> perms     = DistinctPerms.GetPerms(singleton);

            Assert.AreEqual(1, perms.Count);
            Assert.AreEqual(singleton, perms[0]);
            HashSet <string> set = new HashSet <string>(perms);

            Assert.AreEqual(set.Count, perms.Count);
        }
예제 #6
0
 public void NullString()
 {
     Assert.IsNull(DistinctPerms.GetPerms(null));
 }