示例#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;
        }
        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();
        }
        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);
        }
        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);
        }
        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());
        }
        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();
        }
        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();
        }
        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();
 }
 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);
 }