Skip to content

Commit

Permalink
Merge pull request #203 from 0xced/fix-typos
Browse files Browse the repository at this point in the history
Fix many typos
  • Loading branch information
mariotoffia authored Sep 14, 2021
2 parents 1057a1f + a982cf5 commit 35624b6
Show file tree
Hide file tree
Showing 57 changed files with 152 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void StartEventShallBeEmittedWhenContainerStart()

[TestMethod]
[TestCategory("Command")]
public void LogsFromContaierWhenNotFollowModeShallExitByItself()
public void LogsFromContainerWhenNotFollowModeShallExitByItself()
{
string id = null;
try
Expand Down Expand Up @@ -104,7 +104,7 @@ public void LogsFromContaierWhenNotFollowModeShallExitByItself()

[TestMethod]
[TestCategory("Command")]
public void LogsFromContaierWhenInFollowModeShallExitWhenCancelled()
public void LogsFromContainerWhenInFollowModeShallExitWhenCancelled()
{
string id = null;
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void Initialize(TestContext ctx)

[TestMethod]
public async Task
ComposeByBuildImageAddNgixAsLoadBalancerTwoNodesAsHtmlServeAndRedisAsDbBackendShouldWorkAsCluster()
ComposeByBuildImageAddNginxAsLoadBalancerTwoNodesAsHtmlServeAndRedisAsDbBackendShouldWorkAsCluster()
{
// Extract compose file and it's dependencies to a temp folder
var fullPath = (TemplateString)@"${TEMP}\fluentdockertest\${RND}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Ductus.FluentDocker.Tests.ExtensionTests
{
[TestClass]
public class EnironmentExtensionTests
public class EnvironmentExtensionTests
{
[TestMethod]
public void NullStringShallGiveNullReturnInExtract()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void QueryResourcesRecusivelyShallWork()
var resources = typeof(NsResolver);

var res =
resources.ResuorceQuery().Where(x => x.Resource.Equals("Dockerfile") || x.Resource.Equals("index.js")).ToArray();
resources.ResourceQuery().Where(x => x.Resource.Equals("Dockerfile") || x.Resource.Equals("index.js")).ToArray();

Assert.AreEqual(4, res.Length);
Assert.AreEqual(3, res.Count(x => x.Resource == "Dockerfile"));
Expand All @@ -27,7 +27,7 @@ public void QueryResourcesNonRecurivelyShallWork()
{
var resources = typeof(NsResolver);

var res = resources.ResuorceQuery(false).ToArray();
var res = resources.ResourceQuery(false).ToArray();

Assert.AreEqual(1, res.Length);
Assert.AreEqual("docker-compose.yml", res[0].Resource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public void ExportToTarFileWhenDisposeShallWork()

[TestMethod]
[TestCategory("CI")]
public void ExportExploadedWhenDisposeShallWork()
public void ExportExplodedWhenDisposeShallWork()
{
var fullPath = (TemplateString)@"${TEMP}/fluentdockertest/${RND}";
Directory.CreateDirectory(fullPath);
Expand All @@ -392,7 +392,7 @@ public void ExportExploadedWhenDisposeShallWork()
.UseImage("postgres:9.6-alpine")
.ExposePort(5432)
.WithEnvironment("POSTGRES_PASSWORD=mysecretpassword")
.ExportExploadedOnDispose(fullPath)
.ExportExplodedOnDispose(fullPath)
.Build()
.Start())
{
Expand All @@ -418,7 +418,7 @@ public void ExportWithConditionDisposeShallWork()
// ReSharper disable once AssignNullToNotNullAttribute
Directory.CreateDirectory(Path.GetDirectoryName(fullPath));

// Probably the oppsite is reverse where the last statement in the using clause
// Probably the opposite is reverse where the last statement in the using clause
// would set failure = false - but this is a unit test ;)
var failure = false;
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void KeepContainersShallWorkForCompositeServices()
}

[TestMethod]
public void KeepRunningsShallWorkForCompositeServices()
public void KeepRunningShallWorkForCompositeServices()
{
var file = Path.Combine(Directory.GetCurrentDirectory(),
(TemplateString)"Resources/ComposeTests/WordPress/docker-compose.yml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void Initialize(TestContext ctx)
/// As per - http://anandmanisankar.com/posts/docker-container-nginx-node-redis-example/
/// </remarks>
[TestMethod]
public async Task DefineAndBuildImageAddNgixAsLoadBalancerTwoNodesAsHtmlServeAndRedisAsDbBackendShouldWorkAsCluster()
public async Task DefineAndBuildImageAddNginxAsLoadBalancerTwoNodesAsHtmlServeAndRedisAsDbBackendShouldWorkAsCluster()
{
var fullPath = (TemplateString)@"${TEMP}\fluentdockertest\${RND}";
var nginx = Path.Combine(fullPath, "nginx.conf");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void Initialize(TestContext ctx)
}

[TestMethod]
public void BuildImageShallPerserveLineOrdering()
public void BuildImageShallPreserveLineOrdering()
{
var dockerfile = Fd.Dockerfile()
.UseParent("mcr.microsoft.com/windows/servercore:ltsc2019")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ public class ContainerBuilderConfigTests

[DataRow(null, null, null, null, "", "")]
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
null, // INetworkServices With Alias
null, // NetworkNames
null, // NetworkNames With Alias
null, //alias
"NETWORK-SERVICE")]
[DataRow(
null, // INetworkSevices
null, // INetworkServices
new string[] { "NETWORK-SERVICE", "ALIAS" }, // INetworkServices With Alias
null, // NetworkNames
null, // NetworkNames With Alias
"ALIAS", //alias
"NETWORK-SERVICE")]
[DataRow(
null, // INetworkSevices
null, // INetworkServices
null, // INetworkServices With Alias
new string[] { "NETWORK-NAME" }, // NetworkNames
null, // NetworkNames With Alias
null, //alias
"NETWORK-NAME")]
[DataRow(
null, // INetworkSevices
null, // INetworkServices
null, // INetworkServices With Alias
null, // NetworkNames
new string[] { "NETWORK-NAME", "ALIAS" }, // NetworkNames With Alias
Expand All @@ -45,56 +45,56 @@ public class ContainerBuilderConfigTests

#region With INetworkService
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
new string[] { "NETWORK-SERVICE", "ALIAS" }, // INetworkServices With Alias
new string[] { "NETWORK-NAME" }, // NetworkNames
new string[] { "NETWORK-NAME", "ALIAS" }, // NetworkNames With Alias
null, //alias
"NETWORK-SERVICE")]
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
new string[] { "NETWORK-SERVICE", "ALIAS" }, // INetworkServices With Alias
new string[] { "NETWORK-NAME" }, // NetworkNames
null, // NetworkNames With Alias
null, //alias
"NETWORK-SERVICE")]
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
new string[] { "NETWORK-SERVICE", "ALIAS" }, // INetworkServices With Alias
null, // NetworkNames
null, // NetworkNames With Alias
null, //alias
"NETWORK-SERVICE")]
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
null, // INetworkServices With Alias
null, // NetworkNames
null, // NetworkNames With Alias
null, //alias
"NETWORK-SERVICE")]
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
null, // INetworkServices With Alias
new string[] { "NETWORK-NAME" }, // NetworkNames
new string[] { "NETWORK-NAME", "ALIAS" }, // NetworkNames With Alias
null, //alias
"NETWORK-SERVICE")]
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
null, // INetworkServices With Alias
null, // NetworkNames
new string[] { "NETWORK-NAME", "ALIAS" }, // NetworkNames With Alias
null, //alias
"NETWORK-SERVICE")]
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
null, // INetworkServices With Alias
null, // NetworkNames
null, // NetworkNames With Alias
null, //alias
"NETWORK-SERVICE")]
[DataRow(
new string[] { "NETWORK-SERVICE" }, // INetworkSevices
new string[] { "NETWORK-SERVICE" }, // INetworkServices
new string[] { "NETWORK-SERVICE", "ALIAS" }, // INetworkServices With Alias
null, // NetworkNames
new string[] { "NETWORK-NAME", "ALIAS" }, // NetworkNames With Alias
Expand All @@ -104,21 +104,21 @@ public class ContainerBuilderConfigTests

#region INetworkService With Alias
[DataRow(
null, // INetworkSevices
null, // INetworkServices
new string[] { "NETWORK-SERVICE", "ALIAS" }, // INetworkServices With Alias
new string[] { "NETWORK-NAME" }, // NetworkNames
new string[] { "NETWORK-NAME", "ALIAS" }, // NetworkNames With Alias
"ALIAS", //alias
"NETWORK-SERVICE")]
[DataRow(
null, // INetworkSevices
null, // INetworkServices
new string[] { "NETWORK-SERVICE", "ALIAS" }, // INetworkServices With Alias
null, // NetworkNames
new string[] { "NETWORK-NAME", "ALIAS" }, // NetworkNames With Alias
"ALIAS", //alias
"NETWORK-SERVICE")]
[DataRow(
null, // INetworkSevices
null, // INetworkServices
new string[] { "NETWORK-SERVICE", "ALIAS" }, // INetworkServices With Alias
new string[] { "NETWORK-NAME" }, // NetworkNames
null, // NetworkNames With Alias
Expand All @@ -128,7 +128,7 @@ public class ContainerBuilderConfigTests

#region NetworkNames
[DataRow(
null, // INetworkSevices
null, // INetworkServices
null, // INetworkServices With Alias
new string[] { "NETWORK-NAME" }, // NetworkNames
new string[] { "NETWORK-NAME", "ALIAS" }, // NetworkNames With Alias
Expand All @@ -149,7 +149,7 @@ public void FindFirstNetworkNameAndAlias(
Networks = AsINetworkServiceList(networks),
NetworksWithAlias = AsINetworkServiceWithAliasList(networksWithAliases),
NetworkNames = networkNames?.ToList(),
NetworkNamesWithAlias = AsNetworknameWithAliasList(networkNamesWithAliases)
NetworkNamesWithAlias = AsNetworkNameWithAliasList(networkNamesWithAliases)
};

var firstNetwork = config.FindFirstNetworkNameAndAlias();
Expand All @@ -158,7 +158,7 @@ public void FindFirstNetworkNameAndAlias(
Assert.AreEqual(expectedNetworkName, firstNetwork.Network);
}

private List<NetworkWithAlias<string>> AsNetworknameWithAliasList(string[] networkNamesWithAliases)
private List<NetworkWithAlias<string>> AsNetworkNameWithAliasList(string[] networkNamesWithAliases)
{
if (networkNamesWithAliases == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ public void CopyCommandShallDoubleQuoteWrapAllArguments()
}

[TestMethod]
public void CopyCommandShallNotAddDoubleQuoteWrapForArgumentsWithDoubleQote()
public void CopyCommandShallNotAddDoubleQuoteWrapForArgumentsWithDoubleQuote()
{
var cp = new CopyCommand("entrypoint.sh", "\"/worker/entrypoint.sh\"");
Assert.AreEqual("COPY [\"entrypoint.sh\",\"/worker/entrypoint.sh\"]", cp.ToString());
}

[TestMethod]
public void CopyCommandShallEnsureBothSidesAreDoubleQotedEvenIfArgumentHasOnlyOneSide()
public void CopyCommandShallEnsureBothSidesAreDoubleQuotedEvenIfArgumentHasOnlyOneSide()
{
var cp = new CopyCommand("entrypoint.sh", "\"/worker/entrypoint.sh");
Assert.AreEqual("COPY [\"entrypoint.sh\",\"/worker/entrypoint.sh\"]", cp.ToString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public void ExportRunningContainerToTarFileShallSucceed()
}

[TestMethod]
public void ExportRunningContainerExploadedShallSucceed()
public void ExportRunningContainerExplodedShallSucceed()
{
using (var container = _host.Create("postgres:9.6-alpine", false,
new ContainerCreateParams
Expand Down
4 changes: 2 additions & 2 deletions Ductus.FluentDocker.Tests/ServiceTests/NetworkServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void NetworkIsDeletedWhenDisposedAndFlagIsSet()
}

[TestMethod]
public void AttachkWithAliasShallWorkWithIContainerService()
public void AttachWithAliasShallWorkWithIContainerService()
{
using (var nw = _host.CreateNetwork("unit-test-network", removeOnDispose: true))
{
Expand Down Expand Up @@ -118,7 +118,7 @@ public void AttachkWithAliasShallWorkWithIContainerService()
}

[TestMethod]
public void AttachkWithAliasShallWorkWithContainerId()
public void AttachWithAliasShallWorkWithContainerId()
{
using (var nw = _host.CreateNetwork("unit-test-network", removeOnDispose: true))
{
Expand Down
9 changes: 7 additions & 2 deletions Ductus.FluentDocker/Builders/CompositeBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ public CompositeBuilder KeepContainer()
/// compose. Those may be used in a docker-compose file
/// to pass dynamic information such as image labels etc.
/// </summary>
/// <param name="nameValue">An array of name=value string. It is possilbe to have equal sign
/// in the value area since it will use the first encountered equal sign as the enviroment variable
/// <param name="nameValue">An array of name=value string. It is possible to have equal sign
/// in the value area since it will use the first encountered equal sign as the environment variable
/// name and the value.</param>
/// <returns>Itself for fluent access.</returns>
public CompositeBuilder WithEnvironment(params string[] nameValue)
Expand Down Expand Up @@ -305,8 +305,13 @@ public CompositeBuilder ExportOnDispose(string service, string hostPath,
return this;
}

[Obsolete("Please use the properly spelled `ExportExplodedOnDispose` method instead.")]
public CompositeBuilder ExportExploadedOnDispose(string service, string hostPath,
Func<IContainerService, bool> condition = null)
=> ExportExplodedOnDispose(service, hostPath, condition);

public CompositeBuilder ExportExplodedOnDispose(string service, string hostPath,
Func<IContainerService, bool> condition = null)
{
GetContainerSpecificConfig(service).ExportOnDispose =
new Tuple<TemplateString, bool, Func<IContainerService, bool>>(hostPath.EscapePath(), true /*explode*/,
Expand Down
Loading

0 comments on commit 35624b6

Please sign in to comment.