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.
recyclarr/src/Recyclarr.TrashLib.Tests/Config/Settings/SettingsPersisterTest.cs

35 lines
974 B

using Recyclarr.TrashLib.Config.Settings;
using Recyclarr.TrashLib.Config.Yaml;
using Recyclarr.TrashLib.Startup;
namespace Recyclarr.TrashLib.Tests.Config.Settings;
[TestFixture]
[Parallelizable(ParallelScope.All)]
public class SettingsPersisterTest
{
[Test, AutoMockData]
public void Load_should_create_settings_file_if_not_exists(
[Frozen] MockFileSystem fileSystem,
[Frozen] IAppPaths paths,
SettingsProvider sut)
{
_ = sut.Settings;
fileSystem.AllFiles.Should().ContainSingle(paths.SettingsPath.FullName);
}
[Test, AutoMockData]
public void Load_defaults_when_file_does_not_exist(
[Frozen(Matching.ImplementedInterfaces)] YamlSerializerFactory serializerFactory,
[Frozen] IAppPaths paths,
SettingsProvider sut)
{
var expectedSettings = new SettingsValues();
var settings = sut.Settings;
settings.Should().BeEquivalentTo(expectedSettings);
}
}