Ejemplo n.º 1
0
            public void Should_Add_Mandatory_Arguments()
            {
                // Given
                var fixture = new DotNetCoreExecutorFixture();

                fixture.AssemblyPath = "./bin/Debug/app.dll";
                fixture.Settings     = new DotNetCoreExecuteSettings();

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("/Working/bin/Debug/app.dll", result.Args);
            }
Ejemplo n.º 2
0
            public void Should_Add_Verbose()
            {
                // Given
                var fixture = new DotNetCoreExecutorFixture();

                fixture.AssemblyPath     = "./bin/Debug/app.dll";
                fixture.Settings.Verbose = true;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("--verbose /Working/bin/Debug/app.dll", result.Args);
            }
Ejemplo n.º 3
0
            public void Should_Add_Famework_Version()
            {
                // Given
                var fixture = new DotNetCoreExecutorFixture();

                fixture.AssemblyPath = "./Some Folder/Debug/app.dll";
                fixture.Settings.FrameworkVersion = "1.0.3";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("--fx-version 1.0.3 \"/Working/Some Folder/Debug/app.dll\"", result.Args);
            }
Ejemplo n.º 4
0
            public void Should_Add_Host_Arguments()
            {
                // Given
                var fixture = new DotNetCoreExecutorFixture();

                fixture.AssemblyPath = "./bin/Debug/app.dll";
                fixture.Settings.DiagnosticOutput = true;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("--diagnostics \"/Working/bin/Debug/app.dll\"", result.Args);
            }
Ejemplo n.º 5
0
            public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new DotNetCoreExecutorFixture();

                fixture.AssemblyPath = "./bin/Debug/app.dll";
                fixture.Arguments    = "--args";
                fixture.Settings     = new DotNetCoreExecuteSettings();
                fixture.GivenProcessExitsWithCode(1);

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "DotNetCore: Process returned an error (exit code 1).");
            }
Ejemplo n.º 6
0
            public void Should_Throw_If_Process_Was_Not_Started()
            {
                // Given
                var fixture = new DotNetCoreExecutorFixture();

                fixture.AssemblyPath = "./bin/Debug/app.dll";
                fixture.Arguments    = "--args";
                fixture.Settings     = new DotNetCoreExecuteSettings();
                fixture.GivenProcessCannotStart();

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "DotNetCore: Process was not started.");
            }
Ejemplo n.º 7
0
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new DotNetCoreExecutorFixture();

                fixture.AssemblyPath = "./bin/Debug/app.dll";
                fixture.Arguments    = "--args";
                fixture.Settings     = null;
                fixture.GivenDefaultToolDoNotExist();

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsArgumentNullException(result, "settings");
            }