public void Should_Add_Settings() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings.NoBuild = true; fixture.Settings.NoDependencies = true; fixture.Settings.NoRestore = true; fixture.Settings.NoLogo = true; fixture.Settings.Framework = "dnxcore50"; fixture.Settings.Configuration = "Release"; fixture.Settings.Runtime = "runtime1"; fixture.Settings.OutputDirectory = "./artifacts/"; fixture.Settings.VersionSuffix = "rc1"; fixture.Settings.Verbosity = DotNetCoreVerbosity.Minimal; fixture.Settings.Force = true; fixture.Settings.SelfContained = true; fixture.Settings.Sources = new[] { "https://api.nuget.org/v3/index.json" }; // When var result = fixture.Run(); // Then Assert.Equal("publish --output \"/Working/artifacts\" --runtime runtime1 --framework dnxcore50 --configuration Release --version-suffix rc1 --no-build --no-dependencies --no-restore --nologo --force --self-contained true --source \"https://api.nuget.org/v3/index.json\" --verbosity minimal", result.Args); }
public void Should_Add_Mandatory_Arguments() { // Given var fixture = new DotNetCorePublisherFixture(); // When var result = fixture.Run(); // Then Assert.Equal("publish", result.Args); }
public void Should_Quote_Project_Path(string text, string expected) { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Project = text; // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Args); }
public void Should_Add_Path() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Project = "./src/*"; // When var result = fixture.Run(); // Then Assert.Equal("publish \"./src/*\"", result.Args); }
public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.GivenProcessExitsWithCode(1); // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsCakeException(result, ".NET Core CLI: Process returned an error (exit code 1)."); }
public void Should_Throw_If_Process_Was_Not_Started() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.GivenProcessCannotStart(); // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsCakeException(result, ".NET Core CLI: Process was not started."); }
public void Should_Add_PublishReadyToRun() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings.PublishReadyToRun = true; // When var result = fixture.Run(); // Then Assert.Equal("publish -p:PublishReadyToRun=true", result.Args); }
public void Should_Add_TieredCompilation() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings.TieredCompilation = false; // When var result = fixture.Run(); // Then Assert.Equal("publish -p:TieredCompilation=false", result.Args); }
public void Should_Add_Host_Arguments() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings.DiagnosticOutput = true; // When var result = fixture.Run(); // Then Assert.Equal("--diagnostics publish", result.Args); }
public void Should_Add_IncludeAllContentForSelfExtract() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings.IncludeAllContentForSelfExtract = true; // When var result = fixture.Run(); // Then Assert.Equal("publish -p:IncludeAllContentForSelfExtract=true", result.Args); }
public void Should_Add_EnableCompressionInSingleFile() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings.EnableCompressionInSingleFile = true; // When var result = fixture.Run(); // Then Assert.Equal("publish -p:EnableCompressionInSingleFile=true", result.Args); }
public void Should_Throw_If_Settings_Are_Null() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings = null; fixture.GivenDefaultToolDoNotExist(); // When var result = Record.Exception(() => fixture.Run()); // Then AssertEx.IsArgumentNullException(result, "settings"); }
public void Should_Add_Settings() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings.Framework = "dnxcore50"; fixture.Settings.Configuration = "Release"; fixture.Settings.Runtime = "runtime1"; fixture.Settings.OutputDirectory = "./artifacts/"; fixture.Settings.VersionSuffix = "rc1"; fixture.Settings.Verbosity = DotNetCoreVerbosity.Minimal; // When var result = fixture.Run(); // Then Assert.Equal("publish --output \"/Working/artifacts\" --runtime runtime1 --framework dnxcore50 --configuration Release --version-suffix rc1 --verbosity Minimal", result.Args); }
public void Should_Add_Settings() { // Given var fixture = new DotNetCorePublisherFixture(); fixture.Settings.Framework = "dnxcore50"; fixture.Settings.Configuration = "Release"; fixture.Settings.Runtime = "runtime1"; fixture.Settings.BuildBasePath = "./temp/"; fixture.Settings.OutputDirectory = "./artifacts/"; fixture.Settings.NoBuild = true; fixture.Settings.NativeSubDirectory = true; fixture.Settings.VersionSuffix = "rc1"; // When var result = fixture.Run(); // Then Assert.Equal("publish --output \"/Working/artifacts\" --build-base-path \"/Working/temp\" --runtime runtime1 --framework dnxcore50 --configuration Release --version-suffix rc1 --native-subdirectory --no-build", result.Args); }