mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-21 12:36:28 +02:00
Version 3.0.362
This commit is contained in:
parent
cba4da9357
commit
4ff3307997
128 changed files with 3954 additions and 3193 deletions
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
|
@ -39,5 +39,156 @@ namespace UITest.Fixtures.ObjectTests.Map
|
|||
|
||||
Assert.IsTrue(l_oFilter.IsToggleVisible);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that if Konrad is turned off in settings map page filter does no more contain Konrad option.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetFilterDictinaryMapPage_NoKonrad_TinkOnKonradOff()
|
||||
{
|
||||
var l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }), // Last map page filter (Konrad was still available but off)
|
||||
new List<string> { "TINK" }); // Filters from settings page.
|
||||
|
||||
Assert.AreEqual(1, l_oDict.Count);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("TINK"));
|
||||
Assert.AreEqual(FilterState.On, l_oDict["TINK"]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that if Konrad is turned off in settings map page filter does no more contain Konrad option.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetFilterDictinaryMapPage_NoKonrad_TinkOffKonradOn()
|
||||
{
|
||||
var l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }), // Last map page filter (Konrad was still available but off)
|
||||
new List<string> { "TINK" }); // Filters from settings page.
|
||||
|
||||
Assert.AreEqual(1, l_oDict.Count);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("TINK"));
|
||||
Assert.AreEqual(FilterState.On, l_oDict["TINK"]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that if TINK.* is turned off in settings map page filter does no more contain TINK option.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetFilterDictinaryMapPage_NoTink_TinkOnKonradOff()
|
||||
{
|
||||
var l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }), // Last map page filter (Konrad was still available but off)
|
||||
new List<string> { "Konrad" }); // Filters from settings page.
|
||||
|
||||
Assert.AreEqual(1, l_oDict.Count);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("Konrad"));
|
||||
Assert.AreEqual(FilterState.On, l_oDict["Konrad"]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that if Konrad is turned on in settings map page filter is updated with entry Konrad.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetFilterDictinaryMapPage_TinkOn()
|
||||
{
|
||||
var l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }), // Last map page filter (Konrad was still available but off)
|
||||
new List<string> { "TINK", "Konrad" }); // Filters from settings page.
|
||||
|
||||
Assert.AreEqual(2, l_oDict.Count);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("TINK"));
|
||||
Assert.AreEqual(FilterState.Off, l_oDict["TINK"]);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("Konrad"));
|
||||
Assert.AreEqual(FilterState.On, l_oDict["Konrad"]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that if Konrad is turned on in settings map page filter is updated with entry Konrad.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetFilterDictinaryMapPage_TinkOff()
|
||||
{
|
||||
var l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off } }), // Last map page filter (Konrad was still available but off)
|
||||
new List<string> { "TINK", "Konrad" }); // Filters from settings page.
|
||||
|
||||
Assert.AreEqual(2, l_oDict.Count);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("TINK"));
|
||||
Assert.AreEqual(FilterState.Off, l_oDict["TINK"]);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("Konrad"));
|
||||
Assert.AreEqual(FilterState.On, l_oDict["Konrad"]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that map page filters are not touched if state is consitend.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetFilterDictinaryMapPage_AllOn_KonradActivated()
|
||||
{
|
||||
var l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }), // Last map page filter (Konrad was still available but off)
|
||||
new List<string> { "TINK", "Konrad" }); // Filters from settings page.
|
||||
|
||||
Assert.AreEqual(2, l_oDict.Count);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("TINK"));
|
||||
Assert.AreEqual(FilterState.Off, l_oDict["TINK"]);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("Konrad"));
|
||||
Assert.AreEqual(FilterState.On, l_oDict["Konrad"]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that map page filters are not touched if state is consitend..
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetFilterDictinaryMapPage_AllOn_TinkActivated()
|
||||
{
|
||||
var l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }), // Last map page filter (Konrad was still available but off)
|
||||
new List<string> { "TINK", "Konrad" }); // Filters from settings page.
|
||||
|
||||
Assert.AreEqual(2, l_oDict.Count);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("TINK"));
|
||||
Assert.AreEqual(FilterState.On, l_oDict["TINK"]);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("Konrad"));
|
||||
Assert.AreEqual(FilterState.Off, l_oDict["Konrad"]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that map page filters are not touched if state is consitend.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetFilterDictinaryMapPage_NullFilter()
|
||||
{
|
||||
var l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }), // Last map page filter (Konrad was still available but off)
|
||||
null);
|
||||
|
||||
Assert.AreEqual(2, l_oDict.Count, "Do not apply any filter if filter value null is detected.");
|
||||
Assert.IsTrue(l_oDict.ContainsKey("TINK"));
|
||||
Assert.AreEqual(FilterState.On, l_oDict["TINK"]);
|
||||
Assert.IsTrue(l_oDict.ContainsKey("Konrad"));
|
||||
Assert.AreEqual(FilterState.Off, l_oDict["Konrad"]);
|
||||
|
||||
l_oDict = GroupFilterMapPageHelper.CreateUpdated(
|
||||
null,
|
||||
null);
|
||||
|
||||
Assert.IsNull(l_oDict, "Do not apply any filter if filter value null is detected.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDoToggle()
|
||||
{
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }));
|
||||
|
||||
l_oFilter = new TinkKonradToggleViewModel(l_oFilter.FilterDictionary).DoToggle();
|
||||
|
||||
Assert.AreEqual("Konrad", l_oFilter.CurrentFilter);
|
||||
|
||||
l_oFilter = new TinkKonradToggleViewModel(l_oFilter.FilterDictionary).DoToggle();
|
||||
|
||||
Assert.AreEqual("TINK", l_oFilter.CurrentFilter);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
merchantId: "MyMerchId",
|
||||
bluetoothService: Substitute.For<IBluetoothLE>(),
|
||||
locationPermissionsService: Substitute.For<ILocationPermission>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocationService>>(),
|
||||
locksService: new LocksServiceMock(), // Cipher
|
||||
device: new DeviceMock(),
|
||||
specialFolder: new SpecialFolderMock(),
|
||||
|
@ -71,7 +71,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
tinkApp,
|
||||
locationPermission,
|
||||
Substitute.For<IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
Substitute.For<IGeolocationService>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -131,7 +131,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
merchantId: "MyMerchId",
|
||||
bluetoothService: Substitute.For<IBluetoothLE>(),
|
||||
locationPermissionsService: Substitute.For<ILocationPermission>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocationService>>(),
|
||||
locksService: new LocksServiceMock(), // Cipher
|
||||
device: new DeviceMock(),
|
||||
specialFolder: new SpecialFolderMock(),
|
||||
|
@ -152,7 +152,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
NSubstitute.Substitute.For<IGeolocationService>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -209,7 +209,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
merchantId: "MyMerchId",
|
||||
bluetoothService: Substitute.For<IBluetoothLE>(),
|
||||
locationPermissionsService: Substitute.For<ILocationPermission>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocationService>>(),
|
||||
locksService: new LocksServiceMock(), // Cipher
|
||||
device: new DeviceMock(),
|
||||
specialFolder: new SpecialFolderMock(),
|
||||
|
@ -228,7 +228,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
tinkApp,
|
||||
locationPermission,
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
Substitute.For<IGeolocationService>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -282,7 +282,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
merchantId: "MyMerchId",
|
||||
bluetoothService: Substitute.For<IBluetoothLE>(),
|
||||
locationPermissionsService: Substitute.For<ILocationPermission>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocationService>>(),
|
||||
locksService: new LocksServiceMock(), // Cipher
|
||||
device: new DeviceMock(),
|
||||
specialFolder: new SpecialFolderMock(),
|
||||
|
@ -301,7 +301,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
tinkApp,
|
||||
locationPermission,
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
Substitute.For<IGeolocationService>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -355,7 +355,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
merchantId: "MyMerchId",
|
||||
bluetoothService: Substitute.For<IBluetoothLE>(),
|
||||
locationPermissionsService: Substitute.For<ILocationPermission>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocationService>>(),
|
||||
locksService: new LocksServiceMock(), // Cipher
|
||||
device: new DeviceMock(),
|
||||
specialFolder: new SpecialFolderMock(),
|
||||
|
@ -374,7 +374,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
tinkApp,
|
||||
locationPermission,
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
Substitute.For<IGeolocationService>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -444,7 +444,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
merchantId: "MyMerchId",
|
||||
bluetoothService: Substitute.For<IBluetoothLE>(),
|
||||
locationPermissionsService: Substitute.For<ILocationPermission>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocationService>>(),
|
||||
locksService: new LocksServiceMock(), // Cipher
|
||||
device: new DeviceMock(),
|
||||
specialFolder: new SpecialFolderMock(),
|
||||
|
@ -463,7 +463,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
tinkApp,
|
||||
locationPermission,
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
Substitute.For<IGeolocationService>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -534,7 +534,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
merchantId: "MyMerchId",
|
||||
bluetoothService: Substitute.For<IBluetoothLE>(),
|
||||
locationPermissionsService: Substitute.For<ILocationPermission>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocationService>>(),
|
||||
locksService: new LocksServiceMock(), // Cipher
|
||||
device: new DeviceMock(),
|
||||
specialFolder: new SpecialFolderMock(),
|
||||
|
@ -554,7 +554,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
tinkApp,
|
||||
locationPermission,
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
Substitute.For<IGeolocationService>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue