private async Task <string> GetTestCommandArgumentsAsync(string source, TestCommandType testType = TestCommandType.Single) { var workspace = TestHelpers.CreateSimpleWorkspace(source); var context = new AspNet5Context(); var projectName = "project.json"; var projectCounter = 1; context.ProjectContextMapping.Add(projectName, projectCounter); context.Projects.Add(projectCounter, new Project { Path = "project.json", Commands = { { "test", "Xunit.KRunner" } } }); var testCommandProviders = new[] { new AspNet5TestCommandProvider(context, new FakeEnvironment(), new FakeLoggerFactory(), new NullEventEmitter(), new FakeOmniSharpOptions()) }; var controller = new TestCommandController(workspace, testCommandProviders); var lineColumn = TestHelpers.GetLineAndColumnFromDollar(source); var request = new TestCommandRequest { Line = lineColumn.Line, Column = lineColumn.Column, FileName = "dummy.cs", Buffer = source.Replace("$", ""), Type = testType }; var bufferFilter = new UpdateBufferFilter(workspace); bufferFilter.OnActionExecuting(TestHelpers.CreateActionExecutingContext(request, controller)); var testCommand = await controller.GetTestCommand(request); return(testCommand.TestCommand); }
public ProjectSystemController(AspNet5Context aspnet5Context, MSBuildContext msbuildContext, ScriptCsContext scriptCsContext, OmnisharpWorkspace workspace) { _aspnet5Context = aspnet5Context; _msbuildContext = msbuildContext; _scriptCsContext = scriptCsContext; _workspace = workspace; }
public ProjectEventForwarder(AspNet5Context aspnet5Context, MSBuildContext msbuildContext, OmnisharpWorkspace workspace, IEventEmitter emitter) { _aspnet5Context = aspnet5Context; _msbuildContext = msbuildContext; _workspace = workspace; _emitter = emitter; _workspace.WorkspaceChanged += OnWorkspaceChanged; }
public AspNet5WorkspaceInformation(AspNet5Context context) { _context = context; Projects = context.Projects.Values.Select(p => new AspNet5Project(p)); RuntimePath = context.RuntimePath; DesignTimeHostPort = context.DesignTimeHostPort; }
public AspNet5WorkspaceInformation(AspNet5Context context) { _context = context; Projects = context.Projects.Values.Select(project => new AspNet5Project { Path = project.Path, Name = project.Name, Commands = project.Commands, Configurations = project.Configurations, GlobalJsonPath = project.GlobalJsonPath, ProjectSearchPaths = project.ProjectSearchPaths, Frameworks = project.ProjectsByFramework.Keys.ToList() }); RuntimePath = context.RuntimePath; DesignTimeHostPort = context.DesignTimeHostPort; }
private async Task <GetTestCommandResponse> GetTestCommandAsync(string source) { var workspace = TestHelpers.CreateSimpleWorkspace(source); var context = new AspNet5Context(); var projectName = "project.json"; var projectCounter = 1; context.ProjectContextMapping.Add(projectName, projectCounter); context.Projects.Add(projectCounter, new Project { Path = "project.json", Commands = { { "test", "Xunit.KRunner" } } }); var testCommandProviders = new[] { new AspNet5TestCommandProvider(context) }; var controller = new TestCommandController(workspace, testCommandProviders); var request = CreateRequest(source); return(await controller.GetTestCommand(request)); }
public CurrentProjectFacts() { _context = new AspNet5Context(); _workspace = new OmnisharpWorkspace(); }
public ProjectSystemController(AspNet5Context aspnet5Context, MSBuildContext msbuildContext) { _aspnet5Context = aspnet5Context; _msbuildContext = msbuildContext; }