Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
        private void ToolBarItemClick(object sender, RoutedEventArgs e)
        {
            ITextEditorToolBarItem tool = (ITextEditorToolBarItem)((Button)sender).Tag;

            tool.Execute((ITextEditor)mTextEditor);
        }