Example #1
0
            public void CHI_ReturnsExpectedResults()
            {
                ALittleAlliteration alliteration = new ALittleAlliteration();
                var words = alliteration.FindWordsThatStartWith("chi", out _);

                Console.WriteLine("--------------");
                foreach (string word in words)
                {
                    Console.WriteLine(word);
                }
                Assert.IsTrue(words.Contains("child"), "Expected 'child' to be included.");

                Assert.IsFalse(words.Contains("chips"), "Expected 'chips' to be excluded.");
                // ReSharper disable StringLiteralTypo
                Assert.IsFalse(words.Contains("chil"), "Expected 'chil' to be excluded.");
                // ReSharper restore StringLiteralTypo
                Assert.IsFalse(words.Contains("childish"), "Expected 'childish' to be excluded.");
                Assert.IsFalse(words.Contains("chives"), "Expected 'chives' to be excluded.");
            }
Example #2
0
            public void NoWords_ReturnsEmptySet()
            {
                ALittleAlliteration alliteration = new ALittleAlliteration();

                Assert.AreEqual(0, alliteration.FindWordsThatStartWith("aaa", out _).Count);
            }