sharee.bike-App/TestTINKLib/Fixtures/UseCases/ConnectedOffline/TestTinkApp.cs

49 lines
2 KiB
C#
Raw Normal View History

2022-08-30 15:42:25 +02:00
using System;
using NUnit.Framework;
using TestFramework.Model.Device;
2021-07-12 21:31:46 +02:00
using TINK.Model;
using TINK.Repository;
namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
{
using NSubstitute;
2022-04-10 17:38:34 +02:00
using Plugin.BLE.Abstractions.Contracts;
2021-11-14 23:27:29 +01:00
using TestFramework.Model.Services.Geolocation;
using TestFramework.Model.User.Account;
using TestFramework.Services.BluetoothLock;
2021-07-12 21:31:46 +02:00
using TINK.Model.Connector;
using TINK.Services;
2022-08-30 15:42:25 +02:00
using TINK.Services.Geolocation;
2022-04-10 17:38:34 +02:00
using TINK.Services.Permissions;
2021-07-12 21:31:46 +02:00
using static TINK.Repository.CopriCallsMemory;
[TestFixture]
public class TestTinkApp
{
[Test, Explicit("Draft")]
public void TestConstruct()
{
2022-08-30 15:42:25 +02:00
const string MERCH_ID = "MyMerchId";
2021-07-12 21:31:46 +02:00
var l_oApp = new TinkApp(
new TINK.Model.Settings.Settings(
activeLockService: typeof(LocksServiceMock).FullName,
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
2022-04-10 17:38:34 +02:00
isConnectedFunc: () => true,
2022-08-30 15:42:25 +02:00
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,
2022-04-10 17:38:34 +02:00
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
locationServicesContainer: Substitute.For<IServicesContainer<IGeolocation>>(),
locksService: new LocksServiceMock(), // Cipher
device: new DeviceMock(),
specialFolder: new SpecialFolderMock(),
cipher: null,
2022-08-30 15:42:25 +02:00
theme: null,
2021-07-12 21:31:46 +02:00
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
}
}
}