-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from cake-contrib/release/1.0.0
Release/1.0.0
- Loading branch information
Showing
14 changed files
with
365 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 15 additions & 10 deletions
25
src/Cake.DotNetCoreEf.UnitTests/Cake.DotNetCoreEf.UnitTests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Cake.DotNetCoreEf.UnitTests/Fixtures/Migration/DotNetCoreEfMigrationListerFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Cake.DotNetCoreEf.Migration; | ||
|
||
namespace Cake.DotNetCoreEf.Tests.Fixtures.Migration | ||
{ | ||
internal sealed class DotNetCoreEfMigrationListerFixture : DotNetCoreEfFixture<DotNetCoreEfMigrationListerSettings> | ||
{ | ||
public string Project { get; set; } | ||
|
||
public string Arguments { get; set; } | ||
|
||
protected override void RunTool() | ||
{ | ||
var tool = new DotNetCoreEfMigrationLister(FileSystem, Environment, ProcessRunner, Tools); | ||
tool.Script(Project, Arguments, Settings); | ||
} | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
src/Cake.DotNetCoreEf.UnitTests/Unit/Migration/DotNetCoreEfMigrationScriptListerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
using Cake.DotNetCoreEf.Tests.Fixtures.Migration; | ||
using Cake.Testing; | ||
using Xunit; | ||
|
||
namespace Cake.DotNetCoreEf.Tests.Unit.Migration | ||
{ | ||
public sealed class DotNetCoreEfMigrationScriptListerTests | ||
{ | ||
|
||
[Fact] | ||
public void Should_Throw_If_Settings_Are_Null() | ||
{ | ||
// Given | ||
var fixture = new DotNetCoreEfMigrationListerFixture(); | ||
fixture.Project = "./src/"; | ||
fixture.Settings = null; | ||
fixture.GivenDefaultToolDoNotExist(); | ||
|
||
// When | ||
var result = Record.Exception(() => fixture.Run()); | ||
|
||
// Then | ||
AssertExtensions.IsArgumentNullException(result, "settings"); | ||
} | ||
|
||
[Fact] | ||
public void Should_Throw_If_Process_Was_Not_Started() | ||
{ | ||
// Given | ||
var fixture = new DotNetCoreEfMigrationListerFixture(); | ||
fixture.Project = "./src/"; | ||
fixture.GivenProcessCannotStart(); | ||
|
||
// When | ||
var result = Record.Exception(() => fixture.Run()); | ||
|
||
// Then | ||
AssertExtensions.IsCakeException(result, ".NET Core CLI: Process was not started."); | ||
} | ||
|
||
// Removed. Process returns json | ||
//[Fact] | ||
//public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code() | ||
//{ | ||
// // Given | ||
// var fixture = new DotNetCoreEfMigrationScriptListerFixture(); | ||
// fixture.Project = "./src/"; | ||
// fixture.GivenProcessExitsWithCode(1); | ||
|
||
// // When | ||
// var result = Record.Exception(() => fixture.Run()); | ||
|
||
// // Then | ||
// AssertExtensions.IsCakeException(result, ".NET Core CLI: Process returned an error (exit code 1)."); | ||
//} | ||
|
||
[Fact] | ||
public void Should_Add_Mandatory_Arguments() | ||
{ | ||
// Given | ||
var fixture = new DotNetCoreEfMigrationListerFixture(); | ||
|
||
// When | ||
var result = fixture.Run(); | ||
|
||
// Then | ||
Assert.Equal("ef migrations list --no-build --json", result.Args); | ||
} | ||
|
||
[Fact] | ||
public void Should_Add_Path_Arguments() | ||
{ | ||
// Given | ||
var fixture = new DotNetCoreEfMigrationListerFixture(); | ||
fixture.Project = "./tools/tool/"; | ||
fixture.Arguments = "--args=\"value\""; | ||
// When | ||
var result = fixture.Run(); | ||
|
||
// Then | ||
Assert.Equal("ef migrations list --no-build --json --args=\"value\"", result.Args); | ||
Assert.Equal("/Working/tools/tool", result.Process.WorkingDirectory.FullPath); | ||
} | ||
|
||
[Fact] | ||
public void Should_Add_Additional_Settings() | ||
{ | ||
// Given | ||
var fixture = new DotNetCoreEfMigrationListerFixture(); | ||
fixture.Settings.StartupProject = "./src/MyMvcProject"; | ||
fixture.Settings.Project = "./src/MyDataProject"; | ||
fixture.Settings.Configuration = "release"; | ||
fixture.Settings.PrefixOutput = true; | ||
fixture.Settings.NoBuild = true; | ||
// When | ||
var result = fixture.Run(); | ||
|
||
// Then | ||
Assert.Equal("ef migrations list --project \"./src/MyDataProject\" --startup-project \"./src/MyMvcProject\" --prefix-output --no-build --json", result.Args); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28010.2041 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.DotNetCoreEf", "Cake.DotNetCoreEf\Cake.DotNetCoreEf.csproj", "{EF4D86EB-7401-4E38-A02B-AB4884DCB168}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{77CAC347-B714-4AD6-9932-328C59DC9B2B}" | ||
ProjectSection(SolutionItems) = preProject | ||
..\.appveyor.yml = ..\.appveyor.yml | ||
..\build.ps1 = ..\build.ps1 | ||
..\nuspec\Cake.DotNetCoreEf.nuspec = ..\nuspec\Cake.DotNetCoreEf.nuspec | ||
..\LICENSE = ..\LICENSE | ||
..\README.md = ..\README.md | ||
..\recipe.cake = ..\recipe.cake | ||
EndProjectSection | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.DotNetCoreEf.UnitTests", "Cake.DotNetCoreEf.UnitTests\Cake.DotNetCoreEf.UnitTests.csproj", "{8C502FAA-A13C-4051-9716-1C41A4596BED}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {732C4874-8EF7-42F1-82E0-DFF23CD78A46} | ||
EndGlobalSection | ||
EndGlobal | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28010.2041 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.DotNetCoreEf", "Cake.DotNetCoreEf\Cake.DotNetCoreEf.csproj", "{EF4D86EB-7401-4E38-A02B-AB4884DCB168}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{77CAC347-B714-4AD6-9932-328C59DC9B2B}" | ||
ProjectSection(SolutionItems) = preProject | ||
..\.appveyor.yml = ..\.appveyor.yml | ||
..\build.ps1 = ..\build.ps1 | ||
..\nuspec\Cake.DotNetCoreEf.nuspec = ..\nuspec\Cake.DotNetCoreEf.nuspec | ||
..\LICENSE = ..\LICENSE | ||
..\README.md = ..\README.md | ||
..\recipe.cake = ..\recipe.cake | ||
EndProjectSection | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.DotNetCoreEf.UnitTests", "Cake.DotNetCoreEf.UnitTests\Cake.DotNetCoreEf.UnitTests.csproj", "{8C502FAA-A13C-4051-9716-1C41A4596BED}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {732C4874-8EF7-42F1-82E0-DFF23CD78A46} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.