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)); }
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()); }
public void ShowAnalyzeResult(TypoAnalyzerResult result) { }