// Path: dotTrace-common/src/main/java/jetbrains/buildServer/dotTrace/Constants.java
// public class Constants {
//     public static final String USE_VAR = "dot_trace";
//     public static final String PATH_VAR = "dot_trace_path";
//     public static final String THRESHOLDS_VAR = "dot_trace_thresholds";
//     public static final String MEASURE_TYPE_VAR = "dot_trace_measure_type";
//     public static final String PROFILE_CHILD_PROCESSES_VAR = "dot_trace_profile_child_processes";
//     public static final String PROCESS_FILTERS_VAR = "dot_trace_process_filters";
//     public static final String SNAPSHOTS_PATH_VAR = "dot_trace_snapshots_path";
// }


import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import jetbrains.buildServer.dotNet.buildRunner.agent.*;
import jetbrains.buildServer.dotTrace.Constants;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import static org.assertj.core.api.BDDAssertions.then;
        new File("root"),
        new File("path", "abc"),
        "ProfilerCmd" + ourlineSeparator
        + "@SET EXIT_CODE=%ERRORLEVEL%" + ourlineSeparator
        + "ReporterCmd" + ourlineSeparator
        + "@EXIT %EXIT_CODE%"
      },
    };
  }

  @Test(dataProvider = "parseGenerateContentCases")
  public void shouldGenerateContent(@Nullable final File checkoutPath, @NotNull final File toolPath, @NotNull final String expectedContent) {
    // Given
    final File projectFile = new File("project");
    final File snapshotFile = new File(new File("snapshots"), "snapshot.dtp");
    final File patternsFile = new File("patterns");
    final File reportFile = new File("report");
    File path;
    if(checkoutPath != null) {
      path = new File(checkoutPath, toolPath.getPath());
    }
    else {
      path = toolPath;
    }

    final File consoleProfilerFile = new File(path, CmdGenerator.DOT_TRACE_EXE_NAME);
    final File reporterFile = new File(path, CmdGenerator.DOT_TRACE_REPORTER_EXE_NAME);

    final CommandLineSetup setup = new CommandLineSetup("tool", Collections.<CommandLineArgument>emptyList(), Collections.<CommandLineResource>emptyList());
    myCtx.checking(new Expectations() {{
// Path: dotTrace-common/src/main/java/jetbrains/buildServer/dotTrace/Constants.java
// public class Constants {
//     public static final String USE_VAR = "dot_trace";
//     public static final String PATH_VAR = "dot_trace_path";
//     public static final String THRESHOLDS_VAR = "dot_trace_thresholds";
//     public static final String MEASURE_TYPE_VAR = "dot_trace_measure_type";
//     public static final String PROFILE_CHILD_PROCESSES_VAR = "dot_trace_profile_child_processes";
//     public static final String PROCESS_FILTERS_VAR = "dot_trace_process_filters";
//     public static final String SNAPSHOTS_PATH_VAR = "dot_trace_snapshots_path";
// }


// Path: dotTrace-agent/src/test/java/jetbrains/buildServer/dotTrace/agent/CmdGeneratorTest.java
import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import jetbrains.buildServer.dotNet.buildRunner.agent.*;
import jetbrains.buildServer.dotTrace.Constants;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import static org.assertj.core.api.BDDAssertions.then;

        new File("root"),
        new File("path", "abc"),
        "ProfilerCmd" + ourlineSeparator
        + "@SET EXIT_CODE=%ERRORLEVEL%" + ourlineSeparator
        + "ReporterCmd" + ourlineSeparator
        + "@EXIT %EXIT_CODE%"
      },
    };
  }

  @Test(dataProvider = "parseGenerateContentCases")
  public void shouldGenerateContent(@Nullable final File checkoutPath, @NotNull final File toolPath, @NotNull final String expectedContent) {
    // Given
    final File projectFile = new File("project");
    final File snapshotFile = new File(new File("snapshots"), "snapshot.dtp");
    final File patternsFile = new File("patterns");
    final File reportFile = new File("report");
    File path;
    if(checkoutPath != null) {
      path = new File(checkoutPath, toolPath.getPath());
    }
    else {
      path = toolPath;
    }

    final File consoleProfilerFile = new File(path, CmdGenerator.DOT_TRACE_EXE_NAME);
    final File reporterFile = new File(path, CmdGenerator.DOT_TRACE_REPORTER_EXE_NAME);

    final CommandLineSetup setup = new CommandLineSetup("tool", Collections.<CommandLineArgument>emptyList(), Collections.<CommandLineResource>emptyList());
    myCtx.checking(new Expectations() {{
      oneOf(myRunnerParametersService).getRunnerParameter(Constants.PATH_VAR);