You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
873 B
40 lines
873 B
1 year ago
|
using Recyclarr.Repo;
|
||
|
using Recyclarr.Settings;
|
||
2 years ago
|
|
||
1 year ago
|
namespace Recyclarr.Tests.VersionControl;
|
||
2 years ago
|
|
||
|
[TestFixture]
|
||
|
public class GitPathTest
|
||
|
{
|
||
|
[Test, AutoMockData]
|
||
|
public void Default_path_used_when_setting_is_null(
|
||
|
[Frozen] ISettingsProvider settings,
|
||
|
GitPath sut)
|
||
|
{
|
||
2 years ago
|
settings.Settings.Returns(new SettingsValues
|
||
|
{
|
||
|
GitPath = null
|
||
|
});
|
||
2 years ago
|
|
||
|
var result = sut.Path;
|
||
|
|
||
|
result.Should().Be(GitPath.Default);
|
||
|
}
|
||
|
|
||
|
[Test, AutoMockData]
|
||
|
public void User_specified_path_used_instead_of_default(
|
||
|
[Frozen] ISettingsProvider settings,
|
||
|
GitPath sut)
|
||
|
{
|
||
|
var expectedPath = "/usr/local/bin/git";
|
||
2 years ago
|
settings.Settings.Returns(new SettingsValues
|
||
|
{
|
||
|
GitPath = expectedPath
|
||
|
});
|
||
2 years ago
|
|
||
|
var result = sut.Path;
|
||
|
|
||
|
result.Should().Be(expectedPath);
|
||
|
}
|
||
|
}
|