Merge branch 'master' into US-166/location-permission

# Conflicts:
#	TINK/TINK/View/Map/MapPage.xaml.cs
#	TINKLib/ViewModel/Map/MapPageViewModel.cs
#	TestFramework/Services/Permissions/PermissionsMock.cs
#	TestTINKLib/TestTINKLib.csproj
This commit is contained in:
Tobias Reski 2021-11-15 10:06:55 +01:00
commit 30c4e4879b
80 changed files with 2737 additions and 481 deletions

View file

@ -4,9 +4,6 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using TestTINKLib.Mocks.Connector;
using TestTINKLib.Mocks.Device;
using TestTINKLib.Mocks.Services;
using TestTINKLib.Model.User.Account;
using TINK.Model;
using TINK.Model.Connector;
using TINK.Repository.Exception;
@ -14,7 +11,6 @@ using TINK.View;
using TINK.Model.Services.CopriApi;
using TINK.Repository;
using static TINK.Repository.CopriCallsMemory;
using TINK.ViewModel.Map;
using TINK.ViewModel.Settings;
@ -22,6 +18,13 @@ using TINK.ViewModel.Account;
using TINK.Services;
using TINK.Model.Services.Geolocation;
using NSubstitute;
using TestFramework.Model.Device;
using TestFramework.Repository;
using TestFramework.Model.User.Account;
using TestFramework.Model.Services.Geolocation;
using TestFramework.Services.BluetoothLock;
using TestFramework.Services.Permissions;
using TestFramework.Services.CopriApi.Connector;
namespace TestTINKLib.Fixtures.ObjectTests.Account
{
@ -99,7 +102,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
await settingsPageViewModel.OnAppearing();
Assert.AreEqual("Logged in as a@b at TINK.", settingsPageViewModel.LoggedInInfo);
Assert.AreEqual("Logged in as a@b.", settingsPageViewModel.LoggedInInfo);
Assert.IsFalse(settingsPageViewModel.IsBookingStateInfoVisible, "A user is logged but no bikes requested/ booked.");
Assert.AreEqual(string.Empty, settingsPageViewModel.BookingStateInfo);
}
@ -116,8 +119,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
Serilog.Events.LogEventLevel.Error,
activeLockService: typeof(LocksServiceMock).FullName,
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "4da3044c8657a04ba60e2eaa753bc51a", new List<string> { "TINK" })),
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "6103_112e96b36ba33de245943c5ffaf369cd_", new List<string> { "TINK" })),
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
Substitute.For<IServicesContainer<IGeolocation>>(),
new LocksServiceMock(),
new DeviceMock(),
@ -137,7 +140,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
await settingsPageViewModel.OnAppearing();
Assert.AreEqual("Logged in as a@b at TINK.", settingsPageViewModel.LoggedInInfo);
Assert.AreEqual("Logged in as a@b.", settingsPageViewModel.LoggedInInfo);
Assert.IsTrue(settingsPageViewModel.IsBookingStateInfoVisible, "A user is logged but no bikes requested/ booked.");
Assert.AreEqual("Aktuell 2 Fahrräder reserviert/ gebucht.", settingsPageViewModel.BookingStateInfo);
}
@ -154,8 +157,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
Serilog.Events.LogEventLevel.Error,
activeLockService: typeof(LocksServiceMock).FullName,
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "4da3044c8657a04ba60e2eaa753bc51a", new List<string> { "TINK" })),
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "6103_112e96b36ba33de245943c5ffaf369cd_", new List<string> { "TINK" })),
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
Substitute.For<IServicesContainer<IGeolocation>>(),
new LocksServiceMock(),
new DeviceMock(),
@ -175,7 +178,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
await settingsPageViewModel.OnAppearing();
Assert.AreEqual("Logged in as a@b at TINK.", settingsPageViewModel.LoggedInInfo);
Assert.AreEqual("Logged in as a@b.", settingsPageViewModel.LoggedInInfo);
Assert.IsTrue(settingsPageViewModel.IsBookingStateInfoVisible, "A user is logged but no bikes requested/ booked.");
Assert.AreEqual("Aktuell 2 Fahrräder reserviert/ gebucht. Verbindungsstatus: Offline.", settingsPageViewModel.BookingStateInfo);
}
@ -192,7 +195,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
Serilog.Events.LogEventLevel.Error,
activeLockService: typeof(LocksServiceMock).FullName,
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "4da3044c8657a04ba60e2eaa753bc51a", new List<string> { "TINK" })),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "6103_112e96b36ba33de245943c5ffaf369cd_", new List<string> { "TINK" })),
(isConnected, uri, sessionCookie, mail, expiresAfter) => new TINK.Model.Connector.Connector(
uri,
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
@ -203,7 +206,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
TinkApp.MerchantId,
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
sessionCookie: sessionCookie,
cacheServer: new CopriCallsCacheMemory(SampleSets.Set2, sessionCookie: sessionCookie),
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
httpsServer: new ExceptionServer((msg) => new WebConnectFailureException(msg, new Exception("Source expection."))))),
Substitute.For<IServicesContainer<IGeolocation>>(),
new LocksServiceMock(),
@ -224,7 +227,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
await settingsPageViewModel.OnAppearing();
Assert.AreEqual("Logged in as a@b at TINK.", settingsPageViewModel.LoggedInInfo);
Assert.AreEqual("Logged in as a@b.", settingsPageViewModel.LoggedInInfo); // CopriCallsCacheMemory(SampleSets.Set2,
Assert.IsTrue(settingsPageViewModel.IsBookingStateInfoVisible, "A user is logged but no bikes requested/ booked.");
Assert.AreEqual("Aktuell 2 Fahrräder reserviert/ gebucht. Verbindungsstatus: Offline.", settingsPageViewModel.BookingStateInfo);
}