예제 #1
0
파일: C12Q06.cs 프로젝트: mumffy/CtciCsharp
        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
파일: C12Q06.cs 프로젝트: mumffy/CtciCsharp
        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
파일: C12Q06.cs 프로젝트: mumffy/CtciCsharp
        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);
        }