sharee.bike-App/SharedBusinessLogic.Tests/Model/Settings/TestSettings.cs

46 lines
1.4 KiB
C#
Raw Permalink Normal View History

2024-04-09 12:53:23 +02:00
using System;
using NUnit.Framework;
using Serilog.Events;
using ShareeBike.Model.Services.CopriApi.ServerUris;
using ShareeBike.Settings;
using ShareeBike.ViewModel.Map;
using ShareeBike.ViewModel.Settings;
namespace SharedBusinessLogic.Tests.Fixtures.ObjectTests.SettingsNS
{
[TestFixture]
public class TestSettings
{
[Test]
public void TestConstructDefaults()
{
var settings = new ShareeBike.Model.Settings.Settings();
Assert.That(settings.MinimumLogEventLevel, Is.EqualTo(LogEventLevel.Information));
// Was GroupFilterHelper.GetSettingsFilterDefaults when used in ShareeBike- context.
Assert.That(settings.GroupFilterSettings, Is.EqualTo(new GroupFilterSettings()));
// Was GroupFilterHelper.GetMapPageFilterDefaults when used in ShareeBike- context.
Assert.That(settings.GroupFilterMapPage, Is.EqualTo(new GroupFilterMapPage()));
Assert.That(settings.ActiveUri, Is.EqualTo(new CopriServerUriList().ActiveUri));
Assert.That(settings.PollingParameters, Is.EqualTo(PollingParameters.Default));
Assert.That(
settings.CenterMapToCurrentLocation, Is.True,
"Center to map for sharee.bike because bt- locks require location info.");
}
[Test]
public void TestCtorCargo()
{
var settings = new ShareeBike.Model.Settings.Settings(activeUri: new Uri(CopriServerUriList.ShareeBike_LIVE));
Assert.That(
settings.CenterMapToCurrentLocation, Is.False,
"Do not center to current location for ShareeBike.");
}
}
}