コード例 #1
0
        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);
        }
コード例 #2
0
 public ProjectSystemController(AspNet5Context aspnet5Context, MSBuildContext msbuildContext, ScriptCsContext scriptCsContext,
                                OmnisharpWorkspace workspace)
 {
     _aspnet5Context  = aspnet5Context;
     _msbuildContext  = msbuildContext;
     _scriptCsContext = scriptCsContext;
     _workspace       = workspace;
 }
コード例 #3
0
 public ProjectEventForwarder(AspNet5Context aspnet5Context, MSBuildContext msbuildContext, OmnisharpWorkspace workspace, IEventEmitter emitter)
 {
     _aspnet5Context              = aspnet5Context;
     _msbuildContext              = msbuildContext;
     _workspace                   = workspace;
     _emitter                     = emitter;
     _workspace.WorkspaceChanged += OnWorkspaceChanged;
 }
コード例 #4
0
        public AspNet5WorkspaceInformation(AspNet5Context context)
        {
            _context = context;

            Projects = context.Projects.Values.Select(p => new AspNet5Project(p));

            RuntimePath        = context.RuntimePath;
            DesignTimeHostPort = context.DesignTimeHostPort;
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        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));
        }
コード例 #7
0
 public CurrentProjectFacts()
 {
     _context   = new AspNet5Context();
     _workspace = new OmnisharpWorkspace();
 }
コード例 #8
0
 public ProjectSystemController(AspNet5Context aspnet5Context, MSBuildContext msbuildContext)
 {
     _aspnet5Context = aspnet5Context;
     _msbuildContext = msbuildContext;
 }