Exemplo n.º 1
0
        /// <summary>
        /// Ensures that the environment is a windows environment.
        /// <para>WARNING: As calling this method will remove the existing Environment
        /// and replace it with a new one, this method should be called first, before any
        /// other modifications are made.</para>
        /// </summary>
        public void GivenAWindowsEnvironment()
        {
            Environment = FakeEnvironment.CreateWindowsEnvironment();

            // re-create everything that had a reference to the old environment
            // see https://github.com/cake-build/cake/blob/main/src/Cake.Testing/Fixtures/ToolFixture%602.cs#L78
            FileSystem = new FakeFileSystem(Environment);
            Globber    = new Globber(FileSystem, Environment);
            Tools      = new ToolLocator(Environment, new ToolRepository(Environment), new ToolResolutionStrategy(FileSystem, Environment, Globber, Configuration, new NullLog()));

            // re-create the tool (as it, too, had a reference to the environment
            _tool = new GradleRunner(FileSystem, Environment, ProcessRunner, Tools);
        }
Exemplo n.º 2
0
 public GradleRunnerFixture WithSystemProperty(string key, string val, bool secret)
 {
     _tool = _tool.WithSystemProperty(key, val, secret);
     return(this);
 }
Exemplo n.º 3
0
 public GradleRunnerFixture FromPath(DirectoryPath path)
 {
     _tool = _tool.FromPath(path);
     return(this);
 }
Exemplo n.º 4
0
 public GradleRunnerFixture WithArguments(string arguments)
 {
     _tool = _tool.WithArguments(arguments);
     return(this);
 }
Exemplo n.º 5
0
 public GradleRunnerFixture WithTask(params string[] tasks)
 {
     _tool = _tool.WithTask(tasks);
     return(this);
 }
Exemplo n.º 6
0
 public GradleRunnerFixture WithTask(string task)
 {
     _tool = _tool.WithTask(task);
     return(this);
 }
Exemplo n.º 7
0
 // ReSharper disable once UnusedMethodReturnValue.Global
 public GradleRunnerFixture WithLogLevel(GradleLogLevel logLevel)
 {
     _tool = _tool.WithLogLevel(logLevel);
     return(this);
 }
Exemplo n.º 8
0
 public GradleRunnerFixture(Verbosity verbosity) : base("gradle")
 {
     _tool = new GradleRunner(FileSystem, Environment, ProcessRunner, Tools, verbosity);
 }