2020-04-23 04:02:50 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Test
|
|
|
|
|
{
|
|
|
|
|
public class SettingsTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task CanSaveAndLoadSettings()
|
|
|
|
|
{
|
2020-05-25 17:34:25 +00:00
|
|
|
|
var (settings, loadedSettings) = await MainSettings.TryLoadTypicalSettings();
|
2020-04-23 04:02:50 +00:00
|
|
|
|
|
2020-05-25 17:34:25 +00:00
|
|
|
|
if (settings == null || !loadedSettings)
|
2020-04-23 04:02:50 +00:00
|
|
|
|
{
|
|
|
|
|
settings = new MainSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-25 17:34:25 +00:00
|
|
|
|
await MainSettings.SaveSettings(settings);
|
2020-04-23 04:02:50 +00:00
|
|
|
|
|
2020-05-25 17:34:25 +00:00
|
|
|
|
Assert.True((await MainSettings.TryLoadTypicalSettings()).loaded);
|
2020-04-23 04:02:50 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|