public TestServiceProvider(ILoggerFactory loggerFactory)
        {
            _loggerFactory = loggerFactory;
            _logger = _loggerFactory.CreateLogger<TestServiceProvider>();

            _services[typeof(ILoggerFactory)] = _loggerFactory;
            _services[typeof(IOmnisharpEnvironment)] = new FakeEnvironment();
            _services[typeof(IOmnisharpAssemblyLoader)] = new TestOmnisharpAssemblyLoader(_loggerFactory.CreateLogger<TestOmnisharpAssemblyLoader>());
        }
 private async Task<IEnumerable<string>> FindRefactoringsAsync(string source)
 {
     var loader = new TestOmnisharpAssemblyLoader(_loggerFactory.CreateLogger<CodingActionsFacts>());
     var workspace = await TestHelpers.CreateSimpleWorkspace(source);
     var controller = new GetCodeActionsService(workspace, new[] { new NRefactoryCodeActionProvider(loader) });
     var request = CreateRequest(source);
     var response = await controller.Handle(request);
     return response.CodeActions;
 }
Esempio n. 3
0
        public TestServiceProvider(ILoggerFactory loggerFactory)
        {
            _loggerFactory = loggerFactory;
            _logger        = _loggerFactory.CreateLogger <TestServiceProvider>();

            _services[typeof(ILoggerFactory)]           = _loggerFactory;
            _services[typeof(IOmnisharpEnvironment)]    = new FakeEnvironment();
            _services[typeof(IOmnisharpAssemblyLoader)] = new TestOmnisharpAssemblyLoader(_loggerFactory.CreateLogger <TestOmnisharpAssemblyLoader>());
        }