コード例 #1
0
        public void TestAnagramsGeneratorWillReturnHWhenPassedH()
        {
            List <string> expectedAnagrams = new List <string>()
            {
                "H"
            };

            var anagrams = AnagramsGenerator.generateAnagrams("H");

            anagrams.Should().BeEquivalentTo(expectedAnagrams);
        }
コード例 #2
0
        public void TestAnagramsGeneratorWillReturnAllAnagramsWhenPassedHIM()
        {
            List <string> expectedAnagrams = new List <string>()
            {
                "HIM",
                "HMI",
                "MHI",
                "MIH",
                "IHM",
                "IMH"
            };

            var anagrams = AnagramsGenerator.generateAnagrams("HIM");

            anagrams.Should().BeEquivalentTo(expectedAnagrams);
        }
コード例 #3
0
        public void TestAnagramsGeneratorWillReturnAllAnagramsWhenPassedBIRO()
        {
            List <string> expectedAnagrams = new List <string>()
            {
                "BIRO",
                "BIOR",
                "BRIO",
                "BROI",
                "BOIR",
                "BORI",

                "IBRO",
                "IBOR",
                "IRBO",
                "IROB",
                "IOBR",
                "IORB",

                "RBIO",
                "RBOI",
                "RIBO",
                "RIOB",
                "ROIB",
                "ROBI",

                "OBIR",
                "OBRI",
                "OIBR",
                "OIRB",
                "ORBI",
                "ORIB"
            };

            var anagrams = AnagramsGenerator.generateAnagrams("BIRO");

            anagrams.Should().BeEquivalentTo(expectedAnagrams);
        }