コード例 #1
0
 public void CreateFakeWorkbench()
 {
     workbench             = MockWorkbench.CreateWorkbenchWithOneViewContent("test.py");
     fakeConsoleTextEditor = workbench.FakeScriptingConsolePad.FakeConsoleTextEditor;
     fakeConsole           = workbench.FakeScriptingConsolePad.FakeScriptingConsole;
     fakeTextEditor        = workbench.ActiveMockEditableViewContent.MockTextEditor;
 }
コード例 #2
0
        public void Init()
        {
            SD.InitializeForUnitTests();
            textEditor = new MockTextEditor();
            MockTextEditorViewContent viewContent = new MockTextEditorViewContent();

            viewContent.TextEditor = textEditor;
            viewContent.SetFileName(@"d:\projects\test\file.wxs");

            workbench = new MockWorkbench();
            workbench.ViewContentCollection.Add(viewContent);

            MockTextEditorOptions textEditorOptions = new MockTextEditorOptions();
            MockXmlTextWriter     xmlTextWriter     = new MockXmlTextWriter(textEditorOptions);
            WixProject            project           = WixBindingTestsHelper.CreateEmptyWixProject();

            document = new WixDocument(project, new DefaultFileLoader());
            document.LoadXml(GetWixXml());
            document.FileName        = @"d:\projects\test\File.wxs";
            textEditor.Document.Text = GetWixXml();

            MockWixPackageFilesControl packageFilesControl = new MockWixPackageFilesControl();

            packageFilesView = new PackageFilesView(project, workbench, packageFilesControl, xmlTextWriter);

            packageFilesControl.IsDirty = true;
            AddNewChildElementsToDirectory();
            packageFilesView.Write(document);
        }
コード例 #3
0
        public void SetUpFixture()
        {
            mockViewContent      = new MockEditableViewContent();
            mockViewContent.Text =
                "class Foo\r\n" +
                "{\r\n" +
                "    public Foo()\r\n" +
                "    {\r\n" +
                "    }\r\n" +
                "}";

            mockViewContent.PrimaryFileName = "test.cs";

            MockWorkbench       workbench = new MockWorkbench();
            MockWorkbenchWindow window    = new MockWorkbenchWindow();

            window.ActiveViewContent        = mockViewContent;
            workbench.ActiveWorkbenchWindow = window;

            MockTextEditorProperties textEditorProperties = new MockTextEditorProperties();

            textEditorProperties.IndentationSize     = 4;
            textEditorProperties.ConvertTabsToSpaces = true;

            Run(workbench, textEditorProperties);
        }
        public void Init()
        {
            ServiceContainer container = new ServiceContainer();

            markerService = new MockTextMarkerService();
            container.AddService(typeof(ITextMarkerService), markerService);

            // Add xpath marker to document.
            AvalonEditDocumentAdapter doc = new AvalonEditDocumentAdapter(new ICSharpCode.AvalonEdit.Document.TextDocument(), container);

            doc.Text = "<Test/>";
            XPathNodeTextMarker xpathNodeMarker = new XPathNodeTextMarker(doc);
            XPathNodeMatch      nodeMatch       = new XPathNodeMatch("Test", "<Test/>", 0, 1, XPathNodeType.Element);

            xpathNodeMarker.AddMarker(nodeMatch);

            // Add non text editor provider view to workbench.
            workbench = new MockWorkbench();

            nonTextEditorProviderView = new MockViewContent();
            workbench.ViewContentCollection.Add(nonTextEditorProviderView);

            // Add document to view content.
            textEditorView = new MockTextEditorProviderViewContent();
            textEditorView.MockTextEditor.SetDocument(doc);
            workbench.ViewContentCollection.Add(textEditorView);

            command = new RemoveXPathHighlightingCommand(workbench);
        }
コード例 #5
0
        public void Init()
        {
            workbench        = new MockWorkbench();
            project          = WixBindingTestsHelper.CreateEmptyWixProject();
            packageFilesView = new PackageFilesView(project, workbench);

            workbench.ActiveViewContent = packageFilesView;
        }
コード例 #6
0
        public void Init()
        {
            project   = WixBindingTestsHelper.CreateEmptyWixProject();
            factory   = new MockPackageFilesViewFactory();
            workbench = new MockWorkbench();

            view = factory.Create(project, workbench);
        }
コード例 #7
0
        public void Init()
        {
            workbench = new MockWorkbench();
            factory   = new MockPackageFilesViewFactory();
            project   = WixBindingTestsHelper.CreateEmptyWixProject();

            ViewSetupFilesCommand viewCommand = new ViewSetupFilesCommand(factory, workbench);

            viewCommand.Run(project);
        }
        public void Init()
        {
            workbench = new MockWorkbench();

            CreatePackageFilesViewWithDifferentWixProject();
            CreatePackageFilesViewWithProjectToBeUsedWithViewSetupFilesCommandRunMethod();

            factory = new MockPackageFilesViewFactory();
            ViewSetupFilesCommand viewCommand = new ViewSetupFilesCommand(factory, workbench);

            viewCommand.Run(project);
        }
コード例 #9
0
        public void Init()
        {
            MockWorkbench workbench = MockWorkbench.CreateWorkbenchWithOneViewContent(@"C:\Projects\test.rb");

            Properties       p       = new Properties();
            RubyAddInOptions options = new RubyAddInOptions(p);

            options.RubyFileName = @"C:\IronRuby\ir.exe";

            debugger = new MockDebugger();
            command  = new RunRubyCommand(workbench, options, debugger);
            command.Run();
        }
コード例 #10
0
        public void Init()
        {
            workbench = new MockWorkbench();
            window    = new WixDocumentWindow(workbench);

            document          = new WixDocument();
            document.FileName = @"d:\Projects\Test\Files.wxs";

            MockViewContent view = new MockViewContent();

            view.SetFileName(@"d:\projects\test\files.wxs");
            workbench.ActiveViewContent = view;
        }
コード例 #11
0
        public void SetUpFixture()
        {
            MockWorkbench workbench = MockWorkbench.CreateWorkbenchWithOneViewContent("test.cs");

            workbench.ActiveMockEditableViewContent.Text = "class Foo { }";

            MockTextEditorOptions options = workbench.ActiveMockEditableViewContent.MockTextEditorOptions;

            options.IndentationSize     = 4;
            options.ConvertTabsToSpaces = true;

            Run(workbench);
        }
コード例 #12
0
        public void Init()
        {
            MockWorkbench workbench = MockWorkbench.CreateWorkbenchWithOneViewContent(@"C:\Projects\test.py");

            Properties         p       = new Properties();
            PythonAddInOptions options = new PythonAddInOptions(p);

            options.PythonFileName = @"C:\IronPython\ipy.exe";

            debugger = new MockDebugger();
            command  = new RunPythonCommand(workbench, options, debugger);
            command.Run();
        }
        public void Init()
        {
            MockWorkbench workbench = MockWorkbench.CreateWorkbenchWithOneViewContent("test.vb");

            workbench.ActiveMockEditableViewContent.Text =
                "class Foo\r\n" +
                "end class";

            MockTextEditorOptions options = workbench.ActiveMockEditableViewContent.MockTextEditorOptions;

            options.ConvertTabsToSpaces = false;
            options.IndentationSize     = 2;

            Run(workbench);
        }
コード例 #14
0
        public void Init()
        {
            project                 = WixBindingTestsHelper.CreateEmptyWixProject();
            mockWorkbench           = new MockWorkbench();
            mockPackageFilesControl = new MockWixPackageFilesControl();
            textEditorOptions       = new MockTextEditorOptions();
            textEditorOptions.ConvertTabsToSpaces = false;

            xmlTextWriter    = new MockXmlTextWriter(textEditorOptions);
            packageFilesView = new PackageFilesView(project, mockWorkbench, mockPackageFilesControl, xmlTextWriter);

            mockWorkbench.ActiveContent = packageFilesView;

            document = new WixDocument(project, new DefaultFileLoader());
        }
コード例 #15
0
        public void Init()
        {
            existingTextEditor = new MockTextEditor();
            MockTextEditorViewContent viewContent = new MockTextEditorViewContent();

            viewContent.TextEditor = existingTextEditor;
            viewContent.SetFileName(@"d:\projects\test\file.wxs");

            workbench = new MockWorkbench();
            workbench.ViewContentCollection.Add(new MockViewContent());
            workbench.ViewContentCollection.Add(viewContent);

            document          = new WixDocument();
            document.FileName = @"d:\Projects\Test\File.wxs";

            openEditors = new OpenTextEditors(workbench);
        }
コード例 #16
0
        public void Init()
        {
            viewWithOpenWixDocument = new MockTextEditorViewContent();
            viewWithOpenWixDocument.SetFileName(@"d:\projects\test\a.wxs");

            workbench = new MockWorkbench();
            workbench.ViewContentCollection.Add(viewWithOpenWixDocument);

            document          = new WixDocument();
            document.FileName = @"d:\projects\test\a.wxs";

            packageFilesControl          = new MockWixPackageFilesControl();
            packageFilesControl.Document = document;

            project          = WixBindingTestsHelper.CreateEmptyWixProject();
            packageFilesView = new PackageFilesView(project, workbench, packageFilesControl);

            AfterInit();
        }
コード例 #17
0
        public void SetUpFixture()
        {
            // Create dummy view content with the Python script.
            MockViewContent viewContent = new MockViewContent();

            viewContent.PrimaryFileName = @"C:\Projects\test.py";
            MockWorkbenchWindow workbenchWindow = new MockWorkbenchWindow();

            workbenchWindow.ActiveViewContent = viewContent;
            MockWorkbench workbench = new MockWorkbench();

            workbench.ActiveWorkbenchWindow = workbenchWindow;

            // Create the Python binding addin options.
            Properties   p       = new Properties();
            AddInOptions options = new AddInOptions(p);

            options.PythonFileName = @"C:\IronPython\ipy.exe";

            debugger = new MockDebugger();
            command  = new RunPythonCommand(workbench, options, debugger);
            command.Run();
        }
コード例 #18
0
        public void SetUpFixture()
        {
            mockViewContent      = new MockEditableViewContent();
            mockViewContent.Text =
                "class Foo\r\n" +
                "    Public Sub New\r\n" +
                "    End Sub\r\n" +
                "end class";
            mockViewContent.PrimaryFileName = "test.vb";

            MockWorkbench       workbench = new MockWorkbench();
            MockWorkbenchWindow window    = new MockWorkbenchWindow();

            window.ActiveViewContent        = mockViewContent;
            workbench.ActiveWorkbenchWindow = window;

            MockTextEditorProperties textEditorProperties = new MockTextEditorProperties();

            textEditorProperties.ConvertTabsToSpaces = false;
            textEditorProperties.IndentationSize     = 2;

            Run(workbench, textEditorProperties);
        }
コード例 #19
0
 public void Init()
 {
     workbench = new MockWorkbench();
 }
コード例 #20
0
 public void Init()
 {
     workbench = new MockWorkbench();
     activePackageFilesView = new ActivePackageFilesView(workbench);
 }
コード例 #21
0
 public void Init()
 {
     SD.InitializeForUnitTests();
     workbench = new MockWorkbench();
 }
コード例 #22
0
 public void Init()
 {
     SD.InitializeForUnitTests();
     workbench = new MockWorkbench();
     activePackageFilesView = new ActivePackageFilesView(workbench);
 }