-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into GitVersion-calculating-wrong-version-when-…
…building-a-tag
- Loading branch information
Showing
6 changed files
with
92 additions
and
8 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
63 changes: 63 additions & 0 deletions
63
src/GitVersionExe.Tests/ArgumentParserOnBuildServerTests.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,63 @@ | ||
using System; | ||
using GitVersion; | ||
using GitVersion.OutputVariables; | ||
using GitVersionCore.Tests.Helpers; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using NUnit.Framework; | ||
using Shouldly; | ||
|
||
namespace GitVersionExe.Tests | ||
{ | ||
[TestFixture] | ||
public class ArgumentParserOnBuildServerTests : TestBase | ||
{ | ||
private IArgumentParser argumentParser; | ||
|
||
[SetUp] | ||
public void SetUp() | ||
{ | ||
var sp = ConfigureServices(services => | ||
{ | ||
services.AddSingleton<IArgumentParser, ArgumentParser>(); | ||
services.AddSingleton<IGlobbingResolver, GlobbingResolver>(); | ||
services.AddSingleton<ICurrentBuildAgent, MockBuildAgent>(); | ||
}); | ||
argumentParser = sp.GetService<IArgumentParser>(); | ||
} | ||
|
||
[Test] | ||
public void EmptyOnFetchDisabledBuildServerMeansNoFetchIsTrue() | ||
{ | ||
var arguments = argumentParser.ParseArguments(""); | ||
arguments.NoFetch.ShouldBe(true); | ||
} | ||
|
||
private class MockBuildAgent : ICurrentBuildAgent | ||
{ | ||
public bool CanApplyToCurrentContext() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void WriteIntegration(Action<string> writer, VersionVariables variables, bool updateBuildNumber = true) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public string GetCurrentBranch(bool usingDynamicRepos) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public bool PreventFetch() | ||
{ | ||
return true; | ||
} | ||
|
||
public bool ShouldCleanUpRemotes() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} | ||
} |
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