public FakeCakeContext() { testsDir = new DirectoryPath( System.IO.Path.GetFullPath(AppContext.BaseDirectory)); var fileSystem = new FileSystem(); log = new FakeLog(); var environment = new CakeEnvironment(new CakePlatform(), new CakeRuntime()); var globber = new Globber(fileSystem, environment); var args = new FakeCakeArguments(); var registry = new WindowsRegistry(); var toolRepository = new ToolRepository(environment); var config = new FakeConfiguration(); var toolResolutionStrategy = new ToolResolutionStrategy(fileSystem, environment, globber, config, log); IToolLocator tools = new ToolLocator(environment, toolRepository, toolResolutionStrategy); var processRunner = new ProcessRunner(fileSystem, environment, log, tools, config); var dataService = Substitute.For <ICakeDataService>(); context = new CakeContext(fileSystem, environment, globber, log, args, processRunner, registry, tools, dataService, config); context.Environment.WorkingDirectory = testsDir; }
public FakeCakeContext() { testsDir = new DirectoryPath(System.IO.Path.GetFullPath(AppContext.BaseDirectory)); log = new FakeCakeLog(); var fileSystem = new FileSystem(); var environment = new CakeEnvironment(new CakePlatform(), new CakeRuntime(), log); var globber = new Globber(fileSystem, environment); var args = new FakeCakeArguments(); var processRunner = new ProcessRunner(environment, log); var registry = new WindowsRegistry(); var toolRepo = new ToolRepository(environment); var config = new Core.Configuration.CakeConfigurationProvider(fileSystem, environment).CreateConfiguration(testsDir, new Dictionary <string, string>()); var toolResolutionStrategy = new ToolResolutionStrategy(fileSystem, environment, globber, config); var toolLocator = new ToolLocator(environment, toolRepo, toolResolutionStrategy); context = new CakeContext(fileSystem, environment, globber, log, args, processRunner, registry, toolLocator); context.Environment.WorkingDirectory = testsDir; }