Version 3.0.360

This commit is contained in:
Anja 2023-02-22 14:03:35 +01:00
parent 5c0b2e70c9
commit faf68061f4
160 changed files with 2114 additions and 1932 deletions

View file

@ -1,153 +0,0 @@
using System;
using System.Collections.Generic;
using NSubstitute;
using NUnit.Framework;
using TINK.Model.Bikes.BikeInfoNS;
using TINK.Model.Bikes.BikeInfoNS.BikeNS;
using TINK.Model.State;
using IBikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.IBikeInfo;
namespace TestTINKLib.Fixtures.ObjectTests.Bike
{
[TestFixture]
public class TestBikeInfoMutable
{
private class BikeInfoMutable : TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable
{
public BikeInfoMutable(
string id,
LockModel lockModel,
bool isDemo = false,
IEnumerable<string> group = null,
WheelType? wheelType = null,
TypeOfBike? typeOfBike = null,
string description = null,
string stationId = null,
string stationName = null,
Uri operatorUri = null,
RentalDescription tariffDescription = null,
Func<DateTime> dateTimeProvider = null,
IStateInfo stateInfo = null) : base(
new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike(id, lockModel, wheelType, typeOfBike, description),
new TINK.Model.Bikes.BikeInfoNS.DriveNS.Drive(),
TINK.Model.Bikes.BikeInfoNS.BC.DataSource.Copri,
isDemo,
group,
stationId,
stationName,
operatorUri,
tariffDescription,
dateTimeProvider,
stateInfo)
{
}
}
[Test]
public void TestConstruct()
{
var l_oBikeInfo = new BikeInfoMutable("17", LockModel.ILockIt);
Assert.AreEqual("17", l_oBikeInfo.Id);
Assert.IsNull(l_oBikeInfo.StationId);
Assert.AreEqual(InUseStateEnum.Disposable, l_oBikeInfo.State.Value);
Assert.AreEqual(null, l_oBikeInfo.WheelType);
Assert.AreEqual(null, l_oBikeInfo.TypeOfBike);
l_oBikeInfo = new BikeInfoMutable("22", LockModel.ILockIt, false, new List<string> { "TINK" }, WheelType.Trike, TypeOfBike.Cargo, "Test description", "23");
Assert.AreEqual("22", l_oBikeInfo.Id);
Assert.IsFalse(l_oBikeInfo.IsDemo);
Assert.AreEqual("23", l_oBikeInfo.StationId);
Assert.AreEqual(InUseStateEnum.Disposable, l_oBikeInfo.State.Value);
Assert.AreEqual(WheelType.Trike, l_oBikeInfo.WheelType);
Assert.AreEqual(TypeOfBike.Cargo, l_oBikeInfo.TypeOfBike);
}
[Test]
public void TestConstructCopyBooked()
{
// State Booked
var bikeInfoSource = Substitute.For<IBikeInfo>();
var stateSource = Substitute.For<IStateInfo>();
bikeInfoSource.Bike.Returns(new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("22", LockModel.BordComputer, WheelType.Trike, TypeOfBike.Cargo));
bikeInfoSource.StationId.Returns("23");
bikeInfoSource.State.Returns(stateSource);
stateSource.Value.Returns(InUseStateEnum.Booked);
stateSource.From.Returns(new System.DateTime(2018, 01, 03));
stateSource.MailAddress.Returns("a@b");
stateSource.Code.Returns("234");
var bikeInfoTarget = new TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable(bikeInfoSource, "My Station Name");
Assert.AreEqual(InUseStateEnum.Booked, bikeInfoTarget.State.Value);
Assert.AreEqual("22", bikeInfoTarget.Id);
Assert.AreEqual("23", bikeInfoTarget.StationId);
Assert.AreEqual("My Station Name", bikeInfoTarget.StationName);
Assert.AreEqual(WheelType.Trike, bikeInfoTarget.WheelType);
Assert.AreEqual(TypeOfBike.Cargo, bikeInfoTarget.TypeOfBike);
Assert.AreEqual(InUseStateEnum.Booked, bikeInfoTarget.State.Value);
Assert.AreEqual(new System.DateTime(2018, 01, 03), bikeInfoTarget.State.From);
Assert.AreEqual("a@b", bikeInfoTarget.State.MailAddress);
}
[Test]
public void TestConstructCopyReserved()
{
// State Reserved
var bikeInfoSource = Substitute.For<IBikeInfo>();
var stateSource = Substitute.For<IStateInfo>();
bikeInfoSource.Bike.Returns(new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("22", LockModel.BordComputer, WheelType.Trike, TypeOfBike.Cargo));
bikeInfoSource.StationId.Returns("23");
bikeInfoSource.State.Returns(stateSource);
stateSource.Value.Returns(InUseStateEnum.Reserved);
stateSource.From.Returns(new System.DateTime(2018, 01, 03));
stateSource.MailAddress.Returns("a@b");
stateSource.Code.Returns("234");
var bikeInfoTarget = new TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable(bikeInfoSource, "My Station Name");
Assert.AreEqual(InUseStateEnum.Reserved, bikeInfoTarget.State.Value);
Assert.AreEqual("22", bikeInfoTarget.Id);
Assert.AreEqual("23", bikeInfoTarget.StationId);
Assert.AreEqual(WheelType.Trike, bikeInfoTarget.WheelType);
Assert.AreEqual(TypeOfBike.Cargo, bikeInfoTarget.TypeOfBike);
Assert.AreEqual(InUseStateEnum.Reserved, bikeInfoTarget.State.Value);
Assert.AreEqual(new System.DateTime(2018, 01, 03), bikeInfoTarget.State.From);
Assert.AreEqual("a@b", bikeInfoTarget.State.MailAddress);
}
[Test]
public void TestConstructCopyAvailable()
{
// State Disposable
var bikeInfoSource = Substitute.For<IBikeInfo>();
var stateSource = Substitute.For<IStateInfo>();
bikeInfoSource.Bike.Returns(new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("22", LockModel.BordComputer, WheelType.Trike, TypeOfBike.Cargo));
bikeInfoSource.StationId.Returns("23");
bikeInfoSource.State.Returns(stateSource);
stateSource.Value.Returns(InUseStateEnum.Disposable);
var bikeInfoTarget = new TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable(bikeInfoSource, "My Station Name");
Assert.AreEqual(InUseStateEnum.Disposable, bikeInfoTarget.State.Value);
Assert.AreEqual("22", bikeInfoTarget.Id);
Assert.AreEqual("23", bikeInfoTarget.StationId);
Assert.AreEqual(WheelType.Trike, bikeInfoTarget.WheelType);
Assert.AreEqual(TypeOfBike.Cargo, bikeInfoTarget.TypeOfBike);
Assert.AreEqual(InUseStateEnum.Disposable, bikeInfoTarget.State.Value);
Assert.IsNull(bikeInfoTarget.State.From);
}
[Test]
public void TestConstructBikeNull()
{
Assert.That(
() => new TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable(null, "My Station Name"),
Throws.ArgumentNullException);
}
}
}

View file

@ -1,4 +1,4 @@

using System;
using System.IO;
using System.Net;
@ -66,12 +66,12 @@ namespace UITest.Fixtures.Connector
sessionCookie,
merchantId);
string l_oLogoutResponse;
string logoutResponse;
l_oLogoutResponse = Post(l_oCommand, copriHost);
logoutResponse = Post(l_oCommand, copriHost);
/// Extract session cookie from response.
return JsonConvert.DeserializeObject<ResponseContainer<AuthorizationoutResponse>>(l_oLogoutResponse)?.shareejson;
return JsonConvert.DeserializeObject<ResponseContainer<AuthorizationoutResponse>>(logoutResponse)?.shareejson;
#else
return null;
#endif
@ -80,24 +80,24 @@ namespace UITest.Fixtures.Connector
/// <summary>
/// Get list of stations from file.
/// </summary>
/// <param name="p_strCopriHost">URL of the copri host to connect to.</param>
/// <param name="p_strMerchantId">Id of the merchant.</param>
/// <param name="p_strCookie">Auto cookie of user if user is logged in.</param>
/// <param name="copriHost">URL of the copri host to connect to.</param>
/// <param name="merchantId">Id of the merchant.</param>
/// <param name="cookie">Auto cookie of user if user is logged in.</param>
/// <returns>List of files.</returns>
public static StationsAvailableResponse GetStationsAllCall(
string p_strCopriHost,
string p_strMerchantId,
string p_strCookie = null)
string copriHost,
string merchantId,
string cookie = null)
{
var l_oCommand = string.Format(
"request=stations_all&authcookie={0}{1}",
p_strCookie,
p_strMerchantId);
cookie,
merchantId);
#if !WINDOWS_UWP
string l_oStationsAllResponse;
l_oStationsAllResponse = Post(l_oCommand, p_strCopriHost);
l_oStationsAllResponse = Post(l_oCommand, copriHost);
// Extract bikes from response.
return JsonConvert.DeserializeObject<ResponseContainer<StationsAvailableResponse>>(l_oStationsAllResponse)?.shareejson;
@ -110,7 +110,7 @@ namespace UITest.Fixtures.Connector
/// Gets a list of bikes from Copri.
/// </summary>
/// <param name="copriHost">URL of the copri host to connect to.</param>
/// <param name="p_strMerchantId">Id of the merchant.</param>
/// <param name="merchantId">Id of the merchant.</param>
/// <param name="p_strSessionCookie">Cookie to authenticate user.</param>
/// <returns>Response holding list of bikes.</returns>
public static BikesAvailableResponse GetBikesAvailableCall(
@ -136,7 +136,7 @@ namespace UITest.Fixtures.Connector
/// <summary>
/// Gets a list of bikes reserved/ booked by acctive user from Copri.
/// </summary>
/// <param name="p_strMerchantId">Id of the merchant.</param>
/// <param name="merchantId">Id of the merchant.</param>
/// <param name="p_strSessionCookie">Cookie to authenticate user.</param>
/// <returns>Response holding list of bikes.</returns>
public static BikesReservedOccupiedResponse GetBikesOccupiedCall(
@ -163,13 +163,13 @@ namespace UITest.Fixtures.Connector
/// <summary>
/// Gets booking request response.
/// </summary>
/// <param name="p_strMerchantId">Id of the merchant.</param>
/// <param name="merchantId">Id of the merchant.</param>
/// <param name="p_iBikeId">Id of the bike to book.</param>
/// <param name="p_strSessionCookie">Cookie identifying the user.</param>
/// <returns>Response on booking request.</returns>
public static ReservationBookingResponse DoReserveCall(
string copriHost,
string p_strMerchantId,
string merchantId,
string p_iBikeId,
string p_strSessionCookie)
{
@ -178,7 +178,7 @@ namespace UITest.Fixtures.Connector
"request=booking_request&bike={0}&authcookie={1}{2}",
p_iBikeId,
p_strSessionCookie,
p_strMerchantId);
merchantId);
string l_oBikesAvaialbeResponse = Post(l_oCommand, copriHost);
@ -192,13 +192,13 @@ namespace UITest.Fixtures.Connector
/// <summary>
/// Gets canel booking request response.
/// </summary>
/// <param name="p_strMerchantId">Id of the merchant.</param>
/// <param name="merchantId">Id of the merchant.</param>
/// <param name="p_iBikeId">Id of the bike to book.</param>
/// <param name="p_strSessionCookie">Cookie of the logged in user.</param>
/// <returns>Response on cancel booking request.</returns>
public static ReservationCancelReturnResponse DoCancelReservationCall(
string copriHost,
string p_strMerchantId,
string merchantId,
string p_iBikeId,
string p_strSessionCookie)
{
@ -207,7 +207,7 @@ namespace UITest.Fixtures.Connector
"request=booking_cancel&bike={0}&authcookie={1}{2}",
p_iBikeId,
p_strSessionCookie,
p_strMerchantId);
merchantId);
string l_oBikesAvaialbeResponse;
l_oBikesAvaialbeResponse = Post(l_oCommand, copriHost);

View file

@ -1,4 +1,4 @@
using System;
using System;
using NUnit.Framework;
using Rhino.Mocks;
using TINK.Model.Connector;
@ -23,7 +23,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
null /*UI language */,
"", // Not logged in
"",
l_oCopri).Command;
server: l_oCopri).Command;
Assert.AreEqual(typeof(Command), l_oCommand.GetType());
}
@ -41,7 +41,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
null /*UI language */,
"123", // Logged in
"a@b",
l_oCopri).Command;
server: l_oCopri).Command;
Assert.AreEqual(typeof(CommandLoggedIn), l_oCommand.GetType());
}
@ -59,7 +59,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
null /*UI language */,
"",
"",
l_oCopri).Query;
server: l_oCopri).Query;
Assert.AreEqual(typeof(TINK.Model.Connector.Query), l_oQuery.GetType());
}
@ -77,7 +77,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
null /*UI language */,
"123",
"a@b",
l_oCopri).Query;
server: l_oCopri).Query;
Assert.AreEqual(typeof(QueryLoggedIn), l_oQuery.GetType());
}

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using NSubstitute;
@ -22,7 +22,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
null /*UI language */,
string.Empty,
string.Empty,
new CopriCallsMemory001());
server: new CopriCallsMemory001());
var filter = new FilteredConnector(new List<string> { FilterHelper.CARGOBIKE, FilterHelper.CITYBIKE }, connector);
var stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
@ -58,7 +58,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
null /*UI language */,
string.Empty,
string.Empty,
new CopriCallsMemory001());
server: new CopriCallsMemory001());
var l_oFilter = new FilteredConnector(new List<string> { FilterHelper.CARGOBIKE, FilterHelper.CITYBIKE }, l_oConnector);
var l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using NUnit.Framework;
@ -73,7 +73,7 @@ namespace TestTINKLib
null /*UI language */,
string.Empty,
string.Empty,
new CopriCallsMemory("MyMerchId", SampleSets.Set2, 1));
server: new CopriCallsMemory("MyMerchId", SampleSets.Set2, 1));
var l_oStoreMock = new StoreMock(); // Account without user name, password and cookie

View file

@ -47,7 +47,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => true,
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, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -92,7 +92,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "UnknownCookie", new List<string> { "TINK" })),
isConnectedFunc: () => true,
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, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -136,7 +136,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "6103_112e96b36ba33de245943c5ffaf369cd_", new List<string> { "TINK" })),
isConnectedFunc: () => true,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), null /*UI language */, 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, server: new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -179,7 +179,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "6103_112e96b36ba33de245943c5ffaf369cd_", new List<string> { "TINK" })),
isConnectedFunc: () => false,
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)), null /*UI language */, 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, server: new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),

View file

@ -46,7 +46,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)), null /*UI language */, 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, server: new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -127,7 +127,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)), null /*UI language */, 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, server: new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -205,7 +205,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)), null /*UI language */, 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, server: new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -278,7 +278,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)), null /*UI language */, 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, server: new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -351,7 +351,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)), null /*UI language */, 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, server: new CopriCallsMemory001(sessionCookie)),
merchantId: "MyMerchId",
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),

View file

@ -73,7 +73,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "5781_d47fc786e740ef77d85a24bcb6f0ff97_oiF2kahH", new List<string> { "300001", "300029" })),
isConnectedFunc: () => true,
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.ShareeFr01_Set1, 1, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.ShareeFr01_Set1, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: null,
@ -104,7 +104,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
viewService,
url => { });
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
// Verify behaviour
Received.InOrder(() =>
@ -170,7 +170,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "5781_d47fc786e740ef77d85a24bcb6f0ff97_oiF2kahH", new List<string> { "300001", "300029" })),
isConnectedFunc: () => true,
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.ShareeFr01_Set1, 1, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.ShareeFr01_Set1, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: null,
@ -201,7 +201,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
viewService,
url => { });
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
// Verify behaviour
Received.InOrder(() =>
@ -275,7 +275,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "5781_d47fc786e740ef77d85a24bcb6f0ff97_oiF2kahH", new List<string> { "300001", "300029" })),
isConnectedFunc: () => true,
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.ShareeFr01_Set1, 1, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.ShareeFr01_Set1, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: null,
@ -306,7 +306,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
viewService,
url => { });
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
// Verify behaviour
Received.InOrder(() =>
@ -375,7 +375,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "5781_d47fc786e740ef77d85a24bcb6f0ff97_oiF2kahH", new List<string> { "300001", "300029" })),
isConnectedFunc: () => true,
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.ShareeFr01_Set1, 1, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.ShareeFr01_Set1, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: null,
@ -406,7 +406,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
viewService,
url => { });
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
// Verify behaviour
Received.InOrder(() =>
@ -473,7 +473,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "5781_d47fc786e740ef77d85a24bcb6f0ff97_oiF2kahH", new List<string> { "300001", "300029" })),
isConnectedFunc: () => true,
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.ShareeFr01_Set1, 1, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.ShareeFr01_Set1, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: null,
@ -504,7 +504,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
viewService,
url => { });
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
// Verify behaviour
Received.InOrder(() =>
@ -565,7 +565,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "Invalid_SessionCookie", new List<string> { "TINK" })),
isConnectedFunc: () => true,
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, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),
@ -596,7 +596,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
viewService,
url => { });
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
Assert.IsTrue(new List<string> { "Updating...", string.Empty }.Contains(myBikes.StatusInfoText));
@ -632,7 +632,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", false, "4da3044c8657a04ba60e2eaa753bc51a", new List<string> { "TINK" })),
isConnectedFunc: () => false,
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, sessionCookie)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1, sessionCookie)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: null,
@ -663,7 +663,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
viewService,
url => { });
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
Assert.AreEqual("Offline.", myBikes.StatusInfoText);
@ -749,7 +749,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
IsReportLevelVerbose = true
};
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
Assert.AreEqual("Connection interrupted, server unreachable.", myBikes.StatusInfoText);
@ -835,7 +835,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
IsReportLevelVerbose = true
};
await myBikes.OnAppearing();
await myBikes.OnAppearingOrRefresh();
Assert.AreEqual("Connection interrupted.", myBikes.StatusInfoText);

View file

@ -1,4 +1,4 @@
using System;
using System;
using NUnit.Framework;
using TestFramework.Model.Device;
using TINK.Model;
@ -31,7 +31,7 @@ namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => true,
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)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),

View file

@ -33,7 +33,7 @@ namespace TestTINKLib.Fixtures.UseCases.SelectStation
null /*UI language */,
string.Empty,
string.Empty,
new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1));
server: new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1));
var l_oTinkApp = new TinkApp(
new Settings(
@ -47,7 +47,7 @@ namespace TestTINKLib.Fixtures.UseCases.SelectStation
activeGeolocationService: typeof(GeolocationMock).FullName),
new StoreMock(),
isConnectedFunc: () => true,
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)),
connectorFactory: (isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(new AppContextInfo(MERCH_ID, "MyApp", new Version(1, 2)), null /*UI language */, sessionCookie, mail, server: new CopriCallsMemory(MERCH_ID, SampleSets.Set2, 1)),
merchantId: MERCH_ID,
bluetoothService: Substitute.For<IBluetoothLE>(),
locationPermissionsService: Substitute.For<ILocationPermission>(),

View file

@ -99,7 +99,7 @@ namespace TestTINKLib.Mocks.Connector
public Task<ReservationBookingResponse> BookReservedAndStartOpeningAsync(string bikeId, Uri operatorUri)
=> throw new NotImplementedException();
public Task<DoReturnResponse> DoReturn(string bikeId, LocationDto location, ISmartDevice smartDevice, Uri operatorUri)
public Task<DoReturnResponse> DoReturn(string bikeId, LocationDto location, Uri operatorUri)
=> throw new NotImplementedException();
/// <summary> Returns a bike and starts closing. </summary>
@ -109,7 +109,6 @@ namespace TestTINKLib.Mocks.Connector
/// <returns>Response on returning request.</returns>
public Task<DoReturnResponse> ReturnAndStartClosingAsync(
string bikeId,
ISmartDevice smartDevice,
Uri operatorUri)
=> throw new System.Exception("Rückgabe mit mit Schloss schließen Befehl Offlinemodus nicht möglich!");

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -45,14 +45,12 @@
<Compile Include="Fixtures\ObjectTests\Services\TestServicesContainerMutable.cs" />
<Compile Include="Fixtures\ObjectTests\Settings\BluetoothLock\TestLockIt.cs" />
<Compile Include="Fixtures\ObjectTests\ViewModel\Account\TestAccountPageViewModel.cs" />
<None Include="Fixtures\ObjectTests\Bike\BluetoothLock\TestBikeInfo.cs" />
<None Include="Fixtures\ObjectTests\Bike\BluetoothLock\TestLockInfo.cs" />
<None Include="Fixtures\ObjectTests\Bike\BluetoothLock\TestLockInfoHelper.cs" />
<None Include="Fixtures\ObjectTests\Bike\BluetoothLock\TestLockInfoMutable.cs" />
<None Include="Fixtures\ObjectTests\Bike\TestBike.cs" />
<None Include="Fixtures\ObjectTests\Bike\TestBikeCollection.cs" />
<None Include="Fixtures\ObjectTests\Bike\TestBikeCollectionFilter.cs" />
<Compile Include="Fixtures\ObjectTests\Bike\BC\TestBikeInfoMutable.cs" />
<None Include="Fixtures\ObjectTests\Bike\TestBikesAvailableResponse.cs" />
<Compile Include="Fixtures\ObjectTests\Connector\CopriCallsHttpReference.cs" />
<Compile Include="Fixtures\ObjectTests\Connector\Exception\TestAuthcookieNotDefinedException.cs" />
@ -133,7 +131,7 @@
<Version>13.0.2</Version>
</PackageReference>
<PackageReference Include="NSubstitute">
<Version>4.4.0</Version>
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="NUnit">
<Version>3.13.3</Version>
@ -162,7 +160,7 @@
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials">
<Version>1.7.4</Version>
<Version>1.7.5</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>