public void TestMethod1() { //Arrange PACTTextEditor editor = new PACTTextEditor(); editor.TextHandler = new TextHandler(); string fileName = TestResources.GetTestResourcesFile("Pact1.pact"); editor.TextHandler.Text = System.IO.File.ReadAllText(fileName); ITextEditorToolBarItem v = (from x in ((ITextEditor)editor).Tools where x.ToolText == "Export to JSON" select x).SingleOrDefault(); //Act v.Execute(editor); //Assert //TODO: check output }
private void ToolBarItemClick(object sender, RoutedEventArgs e) { ITextEditorToolBarItem tool = (ITextEditorToolBarItem)((Button)sender).Tag; tool.Execute((ITextEditor)mTextEditor); }