public void BasicTest()
        {
            Assert.That(AlphabetSymmetry.Solve(new List <string> {
                "abode", "ABc", "xyzD"
            }),
                        Is.EqualTo(new List <int> {
                4, 3, 1
            }));

            Assert.That(AlphabetSymmetry.Solve(new List <string> {
                "abide", "ABc", "xyz"
            }),
                        Is.EqualTo(new List <int> {
                4, 3, 0
            }));

            Assert.That(AlphabetSymmetry.Solve(new List <string> {
                "IAMDEFANDJKL", "thedefgh", "xyzDEFghijabc"
            }),
                        Is.EqualTo(new List <int> {
                6, 5, 7
            }));

            Assert.That(AlphabetSymmetry.Solve(new List <string> {
                "encode", "abc", "xyzD", "ABmD"
            }),
                        Is.EqualTo(new List <int> {
                1, 3, 1, 3
            }));
        }
示例#2
0
        public void SolveSymmetryTestMultipleValuesFound()
        {
            var words = new List <string> {
                "IAMDEFANDJKL", "thedefgh", "xyzDEFghijabc"
            };

            var alphabetSymmetry = new AlphabetSymmetry();
            var result           = alphabetSymmetry.SolveSymmetry(words);

            Assert.IsTrue(new List <int> {
                6, 5, 7
            }.SequenceEqual(result), "Incorrect");
        }
示例#3
0
        public void SolveSymmetryTestNotValuesFound()
        {
            var words = new List <string> {
                "abide", "ABc", "xyz"
            };

            var alphabetSymmetry = new AlphabetSymmetry();
            var result           = alphabetSymmetry.SolveSymmetry(words);

            Assert.IsTrue(new List <int> {
                4, 3, 0
            }.SequenceEqual(result), "Incorrect");
        }