-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds ncrunch settings, template for docker-compose unit tests
- Loading branch information
1 parent
9c231ec
commit 8ff3d86
Showing
6 changed files
with
79 additions
and
6 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
38 changes: 38 additions & 0 deletions
38
src/Cake.Docker.Tests/Compose/Exec/DockerComposeExecFixture.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,38 @@ | ||
using Cake.Core; | ||
using Cake.Core.Diagnostics; | ||
using Cake.Core.IO; | ||
using Cake.Testing.Fixtures; | ||
using System; | ||
|
||
namespace Cake.Docker.Tests.Compose.Exec | ||
{ | ||
public class DockerComposeExecFixture : ToolFixture<DockerComposeExecSettings>, ICakeContext | ||
{ | ||
public string Service { get; set; } | ||
public string Command { get; set; } | ||
public string[] Args { get; set; } = new string[0]; | ||
|
||
IFileSystem ICakeContext.FileSystem => FileSystem; | ||
|
||
ICakeEnvironment ICakeContext.Environment => Environment; | ||
|
||
public ICakeLog Log => Log; | ||
|
||
ICakeArguments ICakeContext.Arguments => throw new NotImplementedException(); | ||
|
||
IProcessRunner ICakeContext.ProcessRunner => ProcessRunner; | ||
|
||
public IRegistry Registry => Registry; | ||
|
||
public ICakeDataResolver Data => Data; | ||
|
||
public DockerComposeExecFixture() : base("DockerCompose") | ||
{ | ||
ProcessRunner.Process.SetStandardOutput(new string[] { }); | ||
} | ||
protected override void RunTool() | ||
{ | ||
this.DockerComposeExec(Settings, Service, Command, Args); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Cake.Docker.Tests/Compose/Exec/DockerComposeExecTest.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,24 @@ | ||
using NUnit.Framework; | ||
|
||
namespace Cake.Docker.Tests.Compose.Exec | ||
{ | ||
[TestFixture] | ||
public class DockerComposeExecTest | ||
{ | ||
// TODO fixture can't find docker-compose for some reason | ||
//[Test] | ||
//public void WhenDisablePseudoTtyIsSet_AddsItsArgument() | ||
//{ | ||
// var fixture = new DockerComposeExecFixture | ||
// { | ||
// Settings = new DockerComposeExecSettings(), | ||
// Service = "service", | ||
// Command = "command" | ||
// }; | ||
|
||
// var actual = fixture.Run(); | ||
|
||
// Assert.That(actual.Args, Is.EqualTo("docker-compose service command")); | ||
//} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<SolutionConfiguration> | ||
<Settings> | ||
<AllowParallelTestExecution>True</AllowParallelTestExecution> | ||
<SolutionConfigured>True</SolutionConfigured> | ||
</Settings> | ||
</SolutionConfiguration> |