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,8 +1,8 @@
using NUnit.Framework;
using System;
using System;
using NUnit.Framework;
using TestFramework.Model.Device;
using TINK.Model;
using TINK.Repository;
using TestFramework.Model.Device;
namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
{
@ -12,8 +12,8 @@ namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
using TestFramework.Model.User.Account;
using TestFramework.Services.BluetoothLock;
using TINK.Model.Connector;
using TINK.Services.Geolocation;
using TINK.Services;
using TINK.Services.Geolocation;
using TINK.Services.Permissions;
using static TINK.Repository.CopriCallsMemory;
@ -23,14 +23,16 @@ namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
[Test, Explicit("Draft")]
public void TestConstruct()
{
const string MERCH_ID = "MyMerchId";
var l_oApp = new TinkApp(
new TINK.Model.Settings.Settings(
activeLockService: typeof(LocksServiceMock).FullName,
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 CopriCallsMemory(SampleSets.Set2, 1)),
merchantId: "MyMerchId",
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
@ -38,6 +40,7 @@ namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
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
}

View file

@ -1,20 +1,20 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using NSubstitute;
using NUnit.Framework;
using Plugin.BLE.Abstractions.Contracts;
using TestFramework.Model.Device;
using TestFramework.Model.Services.Geolocation;
using TestFramework.Model.User.Account;
using TestFramework.Services.BluetoothLock;
using TINK.Model;
using TINK.Model.Connector;
using System;
using static TINK.Repository.CopriCallsMemory;
using System.Collections.Generic;
using TINK.Repository;
using TINK.ViewModel.Settings;
using NSubstitute;
using TINK.Services;
using TINK.Services.Geolocation;
using TestFramework.Model.Device;
using TestFramework.Model.User.Account;
using TestFramework.Model.Services.Geolocation;
using TestFramework.Services.BluetoothLock;
using TINK.Services.Permissions;
using Plugin.BLE.Abstractions.Contracts;
using TINK.ViewModel.Settings;
using static TINK.Repository.CopriCallsMemory;
namespace TestTINKLib.Fixtures.UseCases.SelectStation
{
@ -25,11 +25,14 @@ namespace TestTINKLib.Fixtures.UseCases.SelectStation
[Test]
public void TestBikesAtStation_AccountStoreMock_NoUser_CopriMock_Set2()
{
const string MERCH_ID = "MyMerchId";
var l_oConnector = new ConnectorCache(
new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)),
new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)),
null /*UI language */,
string.Empty,
string.Empty,
new CopriCallsMemory(SampleSets.Set2, 1));
new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1));
var l_oTinkApp = new TinkApp(
new TINK.Model.Settings.Settings(
@ -42,8 +45,8 @@ namespace TestTINKLib.Fixtures.UseCases.SelectStation
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 CopriCallsMemory(SampleSets.Set2, 1)),
merchantId: "myMerchId",
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
@ -51,6 +54,7 @@ namespace TestTINKLib.Fixtures.UseCases.SelectStation
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
theme: null,
currentVersion: new Version(3, 2, 0, 115),
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
@ -65,7 +69,7 @@ namespace TestTINKLib.Fixtures.UseCases.SelectStation
l_oTinkApp.SelectedStation = new TINK.Model.Station.Station("10", new List<string>(), null);
Assert.AreEqual(
1,
1,
TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.Stations, l_oTinkApp.SelectedStation.Id).Result.Count);
Assert.AreEqual("18", TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.Stations, l_oTinkApp.SelectedStation.Id).Result.GetById("18").Id);

View file

@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using TINK.Model;
using TINK.Model.Bike;
using TINK.Model.Bikes;
using TINK.Model.Station;
using TINK.Model.User;
@ -16,14 +15,14 @@ namespace TestTINKLib.Fixtures.UseCases
public static async Task<BikeCollectionMutable> GetBikesAtStation(
User user,
TINK.Model.Connector.IConnector connector,
IEnumerable<IStation> stations,
IEnumerable<IStation> stations,
string selectedStationId)
{
var l_oBikesAtStation = new BikeCollectionMutable();
var l_oBikesAvailable = (await connector.Query.GetBikesAsync()).Response;
l_oBikesAtStation.Update(l_oBikesAvailable.GetAtStation(selectedStationId), stations);
l_oBikesAtStation.Update(l_oBikesAvailable.GetAtStation(selectedStationId), stations);
return l_oBikesAtStation;
}