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.
35 lines
944 B
35 lines
944 B
2 years ago
|
using System.IO.Abstractions;
|
||
1 year ago
|
using Recyclarr.Platform;
|
||
|
using Recyclarr.Settings;
|
||
1 year ago
|
using Recyclarr.Yaml;
|
||
3 years ago
|
|
||
1 year ago
|
namespace Recyclarr.Tests.Config.Settings;
|
||
3 years ago
|
|
||
|
[TestFixture]
|
||
|
public class SettingsPersisterTest
|
||
|
{
|
||
|
[Test, AutoMockData]
|
||
|
public void Load_should_create_settings_file_if_not_exists(
|
||
2 years ago
|
[Frozen] MockFileSystem fileSystem,
|
||
|
[Frozen] IAppPaths paths,
|
||
|
SettingsProvider sut)
|
||
3 years ago
|
{
|
||
2 years ago
|
_ = sut.Settings;
|
||
3 years ago
|
|
||
2 years ago
|
fileSystem.AllFiles.Should().ContainSingle(paths.AppDataDirectory.File("settings.yml").FullName);
|
||
3 years ago
|
}
|
||
|
|
||
|
[Test, AutoMockData]
|
||
|
public void Load_defaults_when_file_does_not_exist(
|
||
|
[Frozen(Matching.ImplementedInterfaces)] YamlSerializerFactory serializerFactory,
|
||
2 years ago
|
[Frozen] IAppPaths paths,
|
||
|
SettingsProvider sut)
|
||
3 years ago
|
{
|
||
|
var expectedSettings = new SettingsValues();
|
||
|
|
||
2 years ago
|
var settings = sut.Settings;
|
||
3 years ago
|
|
||
2 years ago
|
settings.Should().BeEquivalentTo(expectedSettings);
|
||
3 years ago
|
}
|
||
|
}
|