Version 3.0.337

This commit is contained in:
Anja Müller-Meißner 2022-08-30 15:42:25 +02:00
parent fd0e63cf10
commit 573fe77e12
2336 changed files with 33688 additions and 86082 deletions

View file

@ -1,12 +1,11 @@
using NUnit.Framework;
using System.Collections.Generic;
using System.Collections.Generic;
using NUnit.Framework;
using TINK.Model;
using TINK.ViewModel.Map;
namespace UITest.Fixtures.ObjectTests.ViewModel.Map
{
[TestFixture]
[TestFixture]
public class TestMapPageViewModel
{
/// <summary>
@ -130,7 +129,7 @@ namespace UITest.Fixtures.ObjectTests.ViewModel.Map
{
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);
null);
Assert.AreEqual(2, l_oDict.Count, "Do not apply any filter if filter value null is detected.");
Assert.IsTrue(l_oDict.ContainsKey("TINK"));
@ -150,7 +149,7 @@ namespace UITest.Fixtures.ObjectTests.ViewModel.Map
{
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();
l_oFilter = new TinkKonradToggleViewModel(l_oFilter.FilterDictionary).DoToggle();
Assert.AreEqual("Konrad", l_oFilter.CurrentFilter);

View file

@ -1,28 +1,28 @@
using NUnit.Framework;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TINK.Model;
using TINK.Model.Connector;
using TINK.Repository.Exception;
using TINK.Model.Services.CopriApi;
using TINK.View;
using TINK.ViewModel.Map;
using Xamarin.Forms;
using TINK.ViewModel.Settings;
using TINK.Services.Geolocation;
using TINK.Services;
using NSubstitute;
using TINK.Services.Permissions;
using TestFramework.Services.BluetoothLock;
using NUnit.Framework;
using Plugin.BLE.Abstractions.Contracts;
using TestFramework.Model.Device;
using TestFramework.Model.Services.Geolocation;
using TestFramework.Model.User.Account;
using TestFramework.Model.Device;
using TestFramework.Repository;
using TestFramework.Services.BluetoothLock;
using TestFramework.Services.CopriApi.Connector;
using TINK.Model;
using TINK.Model.Connector;
using TINK.Model.Services.CopriApi;
using TINK.Repository;
using Plugin.BLE.Abstractions.Contracts;
using TINK.Repository.Exception;
using TINK.Services;
using TINK.Services.Geolocation;
using TINK.Services.Permissions;
using TINK.View;
using TINK.ViewModel.Map;
using TINK.ViewModel.Settings;
using Xamarin.Forms;
namespace TestShareeLib.UseCases.Startup
{
@ -44,7 +44,7 @@ namespace TestShareeLib.UseCases.Startup
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => true,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -53,6 +53,7 @@ namespace TestShareeLib.UseCases.Startup
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
theme: null,
postAction: (d, obj) => d(obj),
currentVersion: new Version(3, 2, 0, 115), // Current app version
lastVersion: new Version(3, 0, 173), // Current app version. Must be larger or equal 3.0.173 to
@ -67,7 +68,7 @@ namespace TestShareeLib.UseCases.Startup
var viewModel = new MapPageViewModel(
tinkApp,
locationPermission,
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
Substitute.For<IBluetoothLE>(),
Substitute.For<IGeolocation>(),
(mapspan) => { },
viewService,
@ -123,7 +124,7 @@ namespace TestShareeLib.UseCases.Startup
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => true,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -132,6 +133,7 @@ namespace TestShareeLib.UseCases.Startup
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
theme: null,
postAction: (d, obj) => d(obj),
currentVersion: new Version(3, 2, 0, 115), // Current app version
lastVersion: new Version(3, 0, 173), // Current app version. Must be larger or equal 3.0.173 to
@ -199,7 +201,7 @@ namespace TestShareeLib.UseCases.Startup
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => true,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -208,6 +210,7 @@ namespace TestShareeLib.UseCases.Startup
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
theme: null,
currentVersion: new Version(3, 2, 0, 115), // Current app version
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
@ -257,7 +260,7 @@ namespace TestShareeLib.UseCases.Startup
}
[Test]
public async Task TestConstruct_TinkOnly()
public async Task TestConstruct_TinkOnly()
{
var tinkApp = new TinkApp(
new TINK.Model.Settings.Settings(
@ -270,7 +273,7 @@ namespace TestShareeLib.UseCases.Startup
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => true,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -279,8 +282,9 @@ namespace TestShareeLib.UseCases.Startup
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
theme: null,
currentVersion: new Version(3, 2, 0, 115), // Current app version
lastVersion: new Version(3, 0, 173));
lastVersion: new Version(3, 0, 173));
var viewService = Substitute.For<IViewService>();
var navigationService = Substitute.For<INavigation>();
@ -341,7 +345,7 @@ namespace TestShareeLib.UseCases.Startup
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => false,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -350,6 +354,7 @@ namespace TestShareeLib.UseCases.Startup
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
theme: null,
currentVersion: new Version(3, 2, 0, 115), // Current app version
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
@ -392,7 +397,7 @@ namespace TestShareeLib.UseCases.Startup
Assert.AreEqual(Color.Gray, viewModel.KonradColor, "Konrad bikes are shown.");
Assert.AreEqual("Offline.", viewModel.StatusInfoText);
Assert.AreEqual("Offline.", viewModel.StatusInfoText);
}
finally
{
@ -415,18 +420,20 @@ namespace TestShareeLib.UseCases.Startup
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => false,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new TINK.Model.Connector.Connector(
uri,
new AppContextInfo("oiF2kahH", "sharee.bike.test", new Version(3, 0, 267)),
sessionCookie,
mail,
server: new CopriProviderHttps(
uri,
TinkApp.MerchantId,
new AppContextInfo("oiF2kahH", "sharee.bike.test", new Version(3, 0, 267)),
sessionCookie: sessionCookie,
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
httpsServer: new ExceptionServer((msg) => new WebConnectFailureException(msg, new Exception("Source expection."))))),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new Connector(
uri,
new AppContextInfo("oiF2kahH", "sharee.bike.test", new Version(3, 0, 267)),
null /*UI language */,
sessionCookie,
mail,
server: new CopriProviderHttps(
uri,
TinkApp.MerchantId,
new AppContextInfo("oiF2kahH", "sharee.bike.test", new Version(3, 0, 267)),
null /*UI language */,
sessionCookie: sessionCookie,
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
httpsServer: new ExceptionServer((msg) => new WebConnectFailureException(msg, new Exception("Source expection."))))),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -435,6 +442,7 @@ namespace TestShareeLib.UseCases.Startup
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
theme: null,
currentVersion: new Version(3, 2, 0, 115), // Current app version
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
@ -501,18 +509,20 @@ namespace TestShareeLib.UseCases.Startup
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => false,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new TINK.Model.Connector.Connector(
uri,
new AppContextInfo("oiF2kahH", "sharee.bike.test", new Version(3, 0, 267)),
sessionCookie,
mail,
server: new CopriProviderHttps(
uri,
TinkApp.MerchantId,
new AppContextInfo("oiF2kahH", "sharee.bike.test", new Version(3, 0, 267)),
sessionCookie: sessionCookie,
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
httpsServer: new ExceptionServer((msg) => new Exception(msg)))),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new Connector(
uri,
new AppContextInfo("oiF2kahH", "sharee.bike.test", new Version(3, 0, 267)),
null /*UI language */,
sessionCookie,
mail,
server: new CopriProviderHttps(
uri,
TinkApp.MerchantId,
new AppContextInfo("oiF2kahH", "sharee.bike.test", new Version(3, 0, 267)),
null /*UI language */,
sessionCookie: sessionCookie,
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
httpsServer: new ExceptionServer((msg) => new Exception(msg)))),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -521,6 +531,7 @@ namespace TestShareeLib.UseCases.Startup
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
theme: null,
currentVersion: new Version(3, 2, 0, 115), // Current app version
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
@ -561,7 +572,7 @@ namespace TestShareeLib.UseCases.Startup
// Verify buttons
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
Assert.AreEqual(Color.Blue , viewModel.TinkColor, "TINK bikes are hidden.");
Assert.AreEqual(Color.Blue, viewModel.TinkColor, "TINK bikes are hidden.");
Assert.AreEqual(Color.Gray, viewModel.KonradColor, "Konrad bikes are shown.");