コード例 #1
0
        public void TestAnalyze()
        {
            FakeProgressReporter progressReporter = new FakeProgressReporter();
            var analyzer = new TypoAnalyzer(new FakeFileSystem(), new FakeCorrectWords());
            TypoAnalyzerResult result = analyzer.Analyze(@"c:\dev", "*.cs", progressReporter);

            KeywordOccurrences[] keywords = result.Keywords.ToArray();
            Assert.AreEqual("cruel", keywords[0].Keyword);
            Assert.AreEqual("hello", keywords[1].Keyword);
            Assert.AreEqual("world", keywords[2].Keyword);
            Assert.IsTrue(Enumerable.SequenceEqual(new string[] { "b.cs" }, keywords[0].Occurrences));
        }
コード例 #2
0
        public void TestSetTypoAnalyzerResult()
        {
            IConfiguration          fakeConfiguration   = new FakeConfiguration();
            IProcessLauncher        fakeProcessLauncher = new FakeProcessLauncher();
            IFileSystem             fakeFileSystem      = new FakeFileSystem();
            IErrorReporter          fakeErrorReporter   = new FakeErrorReporter();
            ISelectorWindow         fakeSelectorWindow  = new FakeSelectorWindow(fakeProcessLauncher, fakeConfiguration, fakeFileSystem, fakeErrorReporter);
            SelectorWindowViewModel viewModel           = new SelectorWindowViewModel(fakeSelectorWindow);
            TypoAnalyzerResult      typoAnalyzerResult  = new TypoAnalyzerResult();

            typoAnalyzerResult.AddOccurrence("Hello", "a.cs");
            viewModel.SetTypoAnalyzerResult(typoAnalyzerResult);
            Assert.AreEqual(1, viewModel.Keywords.Count());
        }
コード例 #3
0
 public void ShowAnalyzeResult(TypoAnalyzerResult result)
 {
 }