public void FindSubtextWithinText()
        {
            //Arrange
            var          text     = "testing";
            var          subtext  = "test";
            const string expected = "0";

            //Act
            var characterPositions = _sut.FindMatches(text, subtext);

            //Assert
            Assert.AreEqual(expected, characterPositions.StringForDisplay);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Technical Test!");
            Console.Write("Text:");
            var textValue = Console.ReadLine();

            Console.WriteLine("Subtext:");
            var subtextValue = Console.ReadLine();

            var subTextMatcher      = new SubtextMatchFinder();
            var subtextMatchResults = subTextMatcher.FindMatches(textValue, subtextValue);

            if (subtextMatchResults.DoesContainMatches)
            {
                Console.WriteLine("Matches found at {0}", subtextMatchResults.StringForDisplay);
            }
            else
            {
                Console.WriteLine("No matches found");
            }
        }