2022-08-30 15:42:25 +02:00
|
|
|
|
using System;
|
|
|
|
|
using NUnit.Framework;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
using Serilog.Events;
|
|
|
|
|
using TINK.Model.Services.CopriApi.ServerUris;
|
|
|
|
|
using TINK.Settings;
|
2021-11-14 23:27:29 +01:00
|
|
|
|
using TINK.ViewModel.Map;
|
|
|
|
|
using TINK.ViewModel.Settings;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
|
|
|
|
namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TestSettings
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestConstructDefaults()
|
|
|
|
|
{
|
|
|
|
|
var settings = new TINK.Model.Settings.Settings();
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual(LogEventLevel.Error, settings.MinimumLogEventLevel);
|
|
|
|
|
|
2021-11-14 23:27:29 +01:00
|
|
|
|
// Was GroupFilterHelper.GetSettingsFilterDefaults when used in TINK- context.
|
|
|
|
|
Assert.AreEqual(new GroupFilterSettings(), settings.GroupFilterSettings);
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2021-11-14 23:27:29 +01:00
|
|
|
|
// Was GroupFilterHelper.GetMapPageFilterDefaults when used in TINK- context.
|
|
|
|
|
Assert.AreEqual(new GroupFilterMapPage(), settings.GroupFilterMapPage);
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
|
|
|
|
Assert.AreEqual(new CopriServerUriList().ActiveUri, settings.ActiveUri);
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual(PollingParameters.Default, settings.PollingParameters);
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(
|
2022-08-30 15:42:25 +02:00
|
|
|
|
settings.CenterMapToCurrentLocation,
|
2021-07-12 21:31:46 +02:00
|
|
|
|
"Center to map for sharee.bike because bt- locks require location info.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestCtorTink()
|
|
|
|
|
{
|
|
|
|
|
var settings = new TINK.Model.Settings.Settings(activeUri: new Uri(CopriServerUriList.TINK_LIVE));
|
|
|
|
|
Assert.IsFalse(
|
|
|
|
|
settings.CenterMapToCurrentLocation,
|
|
|
|
|
"Do not center to current location for TINK.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|