示例#1
0
        public void Tests(string input, int minDistance, string minDistWord)
        {
            int distance;

            Assert.Equal(minDistWord, Q06.FindNearestRepeats(out distance, input.Split()));
            Assert.Equal(minDistance, distance);
        }
示例#2
0
        public void NoRepeatsThrowsException()
        {
            int distance;

            string[] input = "aaa bbb c d eee fff g hhh jj".Split();
            Assert.Throws <InvalidOperationException>(() => Q06.FindNearestRepeats(out distance, input));
        }
示例#3
0
        public void Example()
        {
            string[] input = "All work and no play makes for no work no fun and no results".Split();
            int      distance;

            Assert.Equal("no", Q06.FindNearestRepeats(out distance, input));
            Assert.Equal(2, distance);
        }