Skip to content

Commit

Permalink
(build) Fixed remaining build validation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Mar 26, 2021
1 parent 61c035d commit a2985b5
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 114 deletions.
28 changes: 14 additions & 14 deletions src/Cake.Transifex.Tests/TransifexInitRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ namespace Cake.Transifex.Tests

public class TransifexInitRunnerTests
{
private readonly TransifexInitFixture fixture;
private readonly TransifexInitFixture _fixture;

public TransifexInitRunnerTests()
{
this.fixture = new TransifexInitFixture();
_fixture = new TransifexInitFixture();
}

[Theory]
[InlineData(null)]
[InlineData("")]
public void Evaluate_DoesNotSetHostWhenNullOrEmpty(string host)
{
this.fixture.Settings = new TransifexInitSettings { Host = host };
_fixture.Settings = new TransifexInitSettings { Host = host };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("init");
}
Expand All @@ -34,19 +34,19 @@ public void Evaluate_DoesNotSetHostWhenNullOrEmpty(string host)
[InlineData("", "SECRET-PASSWORD")]
public void Evaluate_DoesNotSetUserNameAndPasswordWhenEitherIsEmpty(string userName, string password)
{
this.fixture.Settings = new TransifexInitSettings { Username = userName, Password = password };
_fixture.Settings = new TransifexInitSettings { Username = userName, Password = password };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("init --host www.transifex.com");
}

[Fact]
public void Evaluate_SetHostByDefault()
{
this.fixture.Settings = null;
_fixture.Settings = null;

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("init --host www.transifex.com");
}
Expand All @@ -55,9 +55,9 @@ public void Evaluate_SetHostByDefault()
public void Evaluate_SetsTokenWhenOneIsSpecified()
{
const string token = "MY-AWESOME-TOKEN";
this.fixture.Settings = new TransifexInitSettings { Token = token };
_fixture.Settings = new TransifexInitSettings { Token = token };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("init --host www.transifex.com --token " + token);
}
Expand All @@ -67,9 +67,9 @@ public void Evaluate_SetsUserNameAndPassword()
{
const string userName = "My-Awesome-Username";
const string password = "My-Super-Awesome-Secret-Password";
this.fixture.Settings = new TransifexInitSettings { Username = userName, Password = password };
_fixture.Settings = new TransifexInitSettings { Username = userName, Password = password };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe($"init --host www.transifex.com --user {userName} --pass {password}");
}
Expand All @@ -82,9 +82,9 @@ public void Evaluate_SetsUserNameAndPassword()
[InlineData("token", "userName", "password")]
public void Evaluate_ThrowsArgumentExceptionWhenTokenAndUsernameOrPasswordIsSpecified(string token, string userName, string password)
{
this.fixture.Settings = new TransifexInitSettings { Token = token, Username = userName, Password = password };
_fixture.Settings = new TransifexInitSettings { Token = token, Username = userName, Password = password };

var ex = Assert.Throws<ArgumentException>(() => this.fixture.Run());
var ex = Assert.Throws<ArgumentException>(() => _fixture.Run());

Assert.Equal(Exceptions.TokenAndUsernameException, ex.Message);
}
Expand Down
84 changes: 42 additions & 42 deletions src/Cake.Transifex.Tests/TransifexPullRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace Cake.Transifex.Tests

public class TransifexPullRunnerTests
{
private readonly TransifexPullFixture fixture;
private readonly TransifexPullFixture _fixture;

public TransifexPullRunnerTests()
{
fixture = new TransifexPullFixture();
_fixture = new TransifexPullFixture();
}

[Theory]
Expand All @@ -18,9 +18,9 @@ public TransifexPullRunnerTests()
[InlineData(" ")]
public void Evaluate_DoesNotSetLanguages(string language)
{
this.fixture.Settings = new TransifexPullSettings { Languages = language };
_fixture.Settings = new TransifexPullSettings { Languages = language };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull");
}
Expand All @@ -31,59 +31,59 @@ public void Evaluate_DoesNotSetLanguages(string language)
[InlineData(" ")]
public void Evaluate_DoesNotSetResources(string resources)
{
this.fixture.Settings = new TransifexPullSettings { Resources = resources };
_fixture.Settings = new TransifexPullSettings { Resources = resources };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull");
}

[Fact]
public void Evaluate_SetsAllArgumentWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { All = true };
_fixture.Settings = new TransifexPullSettings { All = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --all");
}

[Fact]
public void Evaluate_SetsDisableOverwriteWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { DisableOverwrite = true };
_fixture.Settings = new TransifexPullSettings { DisableOverwrite = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --disable-overwrite");
}

[Fact]
public void Evaluate_SetsForceArgumentWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { Force = true };
_fixture.Settings = new TransifexPullSettings { Force = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --force");
}

[Fact]
public void Evaluate_SetsLanguagesArgument()
{
this.fixture.Settings = new TransifexPullSettings { Languages = "nb_NO*" };
_fixture.Settings = new TransifexPullSettings { Languages = "nb_NO*" };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --language \"nb_NO*\"");
}

[Fact]
public void Evaluate_SetsMinimumPercWhenNotNull()
{
this.fixture.Settings = new TransifexPullSettings { MinimumPercentage = 50 };
_fixture.Settings = new TransifexPullSettings { MinimumPercentage = 50 };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --minimum-perc 50");
}
Expand All @@ -98,99 +98,99 @@ public void Evaluate_SetsMinimumPercWhenNotNull()
public void Evaluate_SetsModeWhenNotNull(TransifexMode mode)
{
var expected = mode.ToString().ToLowerInvariant();
this.fixture.Settings = new TransifexPullSettings { Mode = mode };
_fixture.Settings = new TransifexPullSettings { Mode = mode };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe($"pull --mode {expected}");
}

[Fact]
public void Evaluate_SetsPseuodArgumentWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { Pseudo = true };
_fixture.Settings = new TransifexPullSettings { Pseudo = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --pseudo");
}

[Fact]
public void Evaluate_SetsResourcesArgument()
{
this.fixture.Settings = new TransifexPullSettings { Resources = "helloworld*" };
_fixture.Settings = new TransifexPullSettings { Resources = "helloworld*" };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --resources \"helloworld*\"");
}

[Fact]
public void Evaluate_SetsSkipArgumentWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { SkipErrors = true };
_fixture.Settings = new TransifexPullSettings { SkipErrors = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --skip");
}

[Fact]
public void Evaluate_SetsSourceArgumentWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { DownloadSourceFiles = true };
_fixture.Settings = new TransifexPullSettings { DownloadSourceFiles = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --source");
}

[Fact]
public void Evaluate_SetsStatusAsCommandToArgumentBuilder()
{
this.fixture.Settings = null;
_fixture.Settings = null;

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull");
}

[Fact]
public void Evaluate_SetsXLiffArgumentWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { UseXliff = true };
_fixture.Settings = new TransifexPullSettings { UseXliff = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --xliff");
}

[Fact]
public void Evaluate_SetsNoInteractiveWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { NoInteractive = true };
_fixture.Settings = new TransifexPullSettings { NoInteractive = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --no-interactive");
}

[Fact]
public void Evaluate_SetsParallelWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { Parallel = true };
_fixture.Settings = new TransifexPullSettings { Parallel = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --parallel");
}

[Fact]
public void Evaluate_DoesNotSetParallelWhenFalse()
{
this.fixture.Settings = new TransifexPullSettings { Parallel = false };
_fixture.Settings = new TransifexPullSettings { Parallel = false };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull");
}
Expand All @@ -201,29 +201,29 @@ public void Evaluate_DoesNotSetParallelWhenFalse()
[InlineData("feature/branch-argument")]
public void Evaluate_SetsBranchArgument(string branch)
{
this.fixture.Settings = new TransifexPullSettings { Branch = branch };
_fixture.Settings = new TransifexPullSettings { Branch = branch };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe($"pull --branch {branch}");
}

[Fact]
public void Evaluate_SetsGitTimestampsWhenTrue()
{
this.fixture.Settings = new TransifexPullSettings { UseGitTimestamps = true };
_fixture.Settings = new TransifexPullSettings { UseGitTimestamps = true };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull --use-git-timestamps");
}

[Fact]
public void Evaluate_DoesNotSetGitTimestampsWhenFalse()
{
this.fixture.Settings = new TransifexPullSettings { UseGitTimestamps = false };
_fixture.Settings = new TransifexPullSettings { UseGitTimestamps = false };

var result = this.fixture.Run();
var result = _fixture.Run();

result.Args.ShouldBe("pull");
}
Expand Down
Loading

0 comments on commit a2985b5

Please sign in to comment.