public void Setup()
        {
            fileSystem = new InMemoryFileSystem();
            environment = new ExecutionEnvironmentStub();

            compiler = new CSharpCompilerTask(fileSystem, environment);
        }
Exemple #2
0
        public void Should_use_nunit_console_for_program_if_not_on_mono()
        {
            var fileSystem = new InMemoryFileSystem();
            var envionrment = new ExecutionEnvironmentStub {IsMonoHandler = () => false};
            var nunit = new NUnitTask(fileSystem, envionrment);

            nunit.Program.ToString().EndsWith("nunit-console.exe").ShouldBe(true);
        }
Exemple #3
0
        public void Should_use_mono_for_program_if_running_on_mono()
        {
            var fileSystem = new InMemoryFileSystem();
            var envionrment = new ExecutionEnvironmentStub {IsMonoHandler = () => true};
            var nunit = new NUnitTask(fileSystem, envionrment);

            nunit.Program.ShouldEqual(new Path("mono"));
        }
Exemple #4
0
 public void Should_support_disabling_shadow_copy()
 {
     var fileSystem = new InMemoryFileSystem();
     var environment = new ExecutionEnvironmentStub();
     var nunit = new NUnitTask(fileSystem, environment) {ShadowCopy = false};
     environment.RunHandler += (p, args, x) => args.Contains("-noshadow").ShouldBe(true);
     nunit.Run();
 }
Exemple #5
0
 public void Arguments_should_contain_Target()
 {
     var fileSystem = new InMemoryFileSystem();
     var environment = new ExecutionEnvironmentStub();
     var nunit = new NUnitTask(fileSystem, environment) {Target = new Path("MyTests.dll")};
     environment.RunHandler += (p, args, x) => args.Contains("MyTests.dll").ShouldBe(true);
     nunit.Run();
 }
Exemple #6
0
 public void NUnitPath_should_be_based_on_NUnitBinPath()
 {
     var fileSystem = new InMemoryFileSystem();
     var envionrment = new ExecutionEnvironmentStub {IsMonoHandler = () => false};
     var nunit = new NUnitTask(fileSystem, envionrment);
     var binPath = new Path("NUnit").Combine("bin");
     nunit.NUnitBinPath = binPath;
     nunit.NUnitPath.ShouldEqual(binPath.Combine("nunit-console.exe"));
 }
Exemple #7
0
        public void Arguments_should_start_with_NUnitPath_on_mono()
        {
            var fileSystem = new InMemoryFileSystem();
            var environment = new ExecutionEnvironmentStub {IsMonoHandler = () => true};
            var nunit = new NUnitTask(fileSystem, environment);

            environment.RunHandler += (p, args, x) => args.StartsWith(nunit.NUnitPath.ToString()).ShouldBe(true);
            nunit.Run();
        }
Exemple #8
0
 public void Should_support_disabling_logo()
 {
     var fileSystem = new InMemoryFileSystem();
     var environment = new ExecutionEnvironmentStub();
     var nunit = new NUnitTask(fileSystem, environment) {ShowLogo = false};
     environment.RunHandler = (p, args, x) =>
     {
         args.Contains("-nologo").ShouldBe(true);
     };
     nunit.Run();
 }
Exemple #9
0
 public void Execute_should_call_wait_for_exit_before_ExitCode()
 {
     //Since mono is broken and won't give us the ExitCode otherwise.
     var process = new ProcessStub();
     var waitForExitCalled = false;
     process.WaitForExitHandler = () => waitForExitCalled = true;
     process.GetExitCodeHandler = () =>
     {
         Assert.IsTrue(waitForExitCalled);
         return 0;
     };
     var platform = new ExecutionEnvironmentStub();
     var fileSystem = new InMemoryFileSystem();
     platform.RunHandler = (program, args, handler) => handler(process);
     var task = new TestTask(fileSystem, platform);
     task.Run();
 }