public DebugServiceTests()
        {
            var logger = NullLogger.Instance;

            this.powerShellContext = PowerShellContextFactory.Create(logger);
            this.powerShellContext.SessionStateChanged += powerShellContext_SessionStateChanged;

            this.workspace = new WorkspaceService(NullLoggerFactory.Instance);

            // Load the test debug files
            this.debugScriptFile    = GetDebugScript("DebugTest.ps1");
            this.variableScriptFile = GetDebugScript("VariableTest.ps1");

            this.debugService = new DebugService(
                this.powerShellContext,
                null,
                new BreakpointService(
                    NullLoggerFactory.Instance,
                    powerShellContext,
                    new DebugStateService()),
                NullLoggerFactory.Instance);

            this.debugService.DebuggerStopped   += debugService_DebuggerStopped;
            this.debugService.BreakpointUpdated += debugService_BreakpointUpdated;
        }
        public async Task InitializeAsync()
        {
            var logger = Logging.NullLogger;

            this.powerShellContext = PowerShellContextFactory.Create(logger);
            await this.powerShellContext.ImportCommandsModuleAsync(
                TestUtilities.NormalizePath("../../../../../module/PowerShellEditorServices/Commands"));

            this.extensionService = new ExtensionService(this.powerShellContext);
            this.editorOperations = new TestEditorOperations();

            this.extensionService.CommandAdded   += ExtensionService_ExtensionAdded;
            this.extensionService.CommandUpdated += ExtensionService_ExtensionUpdated;
            this.extensionService.CommandRemoved += ExtensionService_ExtensionRemoved;

            await this.extensionService.InitializeAsync(
                this.editorOperations,
                new ComponentRegistry());

            var filePath = TestUtilities.NormalizePath("c:/Test/Test.ps1");

            this.currentFile    = new ScriptFile(filePath, filePath, "This is a test file", new Version("5.0"));
            this.commandContext =
                new EditorContext(
                    this.editorOperations,
                    currentFile,
                    new BufferPosition(1, 1),
                    BufferRange.None);
        }
Пример #3
0
        public DebugServiceTests()
        {
            var logger = Logging.NullLogger;

            this.powerShellContext = PowerShellContextFactory.Create(logger);
            this.powerShellContext.SessionStateChanged += powerShellContext_SessionStateChanged;

            this.workspace = new Workspace(this.powerShellContext.LocalPowerShellVersion.Version, logger);

            // Load the test debug file
            this.debugScriptFile =
                this.workspace.GetFile(
                    @"..\..\..\..\PowerShellEditorServices.Test.Shared\Debugging\DebugTest.ps1");

            this.variableScriptFile =
                this.workspace.GetFile(
                    @"..\..\..\..\PowerShellEditorServices.Test.Shared\Debugging\VariableTest.ps1");

            this.debugService = new DebugService(this.powerShellContext, logger);
            this.debugService.DebuggerStopped   += debugService_DebuggerStopped;
            this.debugService.BreakpointUpdated += debugService_BreakpointUpdated;
            this.runnerContext = SynchronizationContext.Current;

            // Load the test debug file
            this.debugScriptFile =
                this.workspace.GetFile(
                    @"..\..\..\..\PowerShellEditorServices.Test.Shared\Debugging\DebugTest.ps1");
        }
        public async Task InitializeAsync()
        {
            var logger = new NullLogger();

            this.powerShellContext = PowerShellContextFactory.Create(logger);
            await this.powerShellContext.ImportCommandsModule(@"..\..\..\..\..\module\PowerShellEditorServices\Commands");

            this.extensionService = new ExtensionService(this.powerShellContext);
            this.editorOperations = new TestEditorOperations();

            this.extensionService.CommandAdded   += ExtensionService_ExtensionAdded;
            this.extensionService.CommandUpdated += ExtensionService_ExtensionUpdated;
            this.extensionService.CommandRemoved += ExtensionService_ExtensionRemoved;

            await this.extensionService.Initialize(this.editorOperations);

            var filePath = @"c:\Test\Test.ps1";

            this.currentFile    = new ScriptFile(filePath, filePath, "This is a test file", new Version("5.0"));
            this.commandContext =
                new EditorContext(
                    this.editorOperations,
                    currentFile,
                    new BufferPosition(1, 1),
                    BufferRange.None);
        }
Пример #5
0
        public LanguageServiceTests()
        {
            var logger = Logging.NullLogger;

            this.powerShellContext = PowerShellContextFactory.Create(logger);
            this.workspace         = new Workspace(this.powerShellContext.LocalPowerShellVersion.Version, logger);
            this.languageService   = new LanguageService(this.powerShellContext, logger);
        }
        public LanguageServiceTests()
        {
            var logger = NullLogger.Instance;

            powerShellContext = PowerShellContextFactory.Create(logger);
            workspace         = new WorkspaceService(NullLoggerFactory.Instance);
            symbolsService    = new SymbolsService(NullLoggerFactory.Instance, powerShellContext, workspace, new ConfigurationService());
            completionHandler = new PsesCompletionHandler(NullLoggerFactory.Instance, powerShellContext, workspace);
        }
 public PowerShellContextTests()
 {
     this.powerShellContext = PowerShellContextFactory.Create(Logging.NullLogger);
     this.powerShellContext.SessionStateChanged += OnSessionStateChanged;
     this.stateChangeQueue = new AsyncQueue <SessionStateChangedEventArgs>();
 }