mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-21 20:46:28 +02:00
Version 3.0.261
This commit is contained in:
parent
8aa3089f32
commit
4bccfe740b
80 changed files with 2672 additions and 458 deletions
|
@ -31,10 +31,10 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector.Filter
|
|||
[Test]
|
||||
public void TestDoFilter()
|
||||
{
|
||||
var filter = new IntersectGroupFilter(new List<string> { "Tonk", "Honk" });
|
||||
var filter = new IntersectGroupFilter(new List<string> { "FR_001", "FR_009" });
|
||||
|
||||
Assert.AreEqual(1, filter.DoFilter(new List<string> { "Tonk", "Klonk" }).Count());
|
||||
Assert.AreEqual("Tonk", filter.DoFilter(new List<string> { "Tonk", "Klonk" }).ToArray()[0]);
|
||||
Assert.AreEqual(1, filter.DoFilter(new List<string> { "FR_001", "FR_007" }).Count());
|
||||
Assert.AreEqual("FR_001", filter.DoFilter(new List<string> { "FR_001", "FR_007" }).ToArray()[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using TINK.Model.Connector;
|
||||
using System.Linq;
|
||||
using TINK.Repository;
|
||||
using TestFramework.Repository;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
||||
{
|
||||
|
@ -15,34 +16,34 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
[Test]
|
||||
public void TestGetStationsAll()
|
||||
{
|
||||
var l_oConnector = new ConnectorCache(
|
||||
var connector = new ConnectorCache(
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory(CopriCallsMemory.SampleSets.Set2, 1));
|
||||
new CopriCallsMemory001());
|
||||
|
||||
var l_oFilter = new FilteredConnector(new List<string> { "TINK", "Konrad" }, l_oConnector);
|
||||
var l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(9, l_oStations.StationsAll.Count());
|
||||
var filter = new FilteredConnector(new List<string> { FilterHelper.FILTERTINKGENERAL, FilterHelper.FILTERKONRAD }, connector);
|
||||
var stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(41, stations.StationsAll.Count()); // Count of stations was 9 before switching to data provider CopriCallsMemory(CopriCallsMemory.SampleSets.Set2, 1)
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "TINK" }, l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(8, l_oStations.StationsAll.Count());
|
||||
filter = new FilteredConnector(new List<string> { FilterHelper.FILTERTINKGENERAL }, connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(21, stations.StationsAll.Count());
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "Konrad" }, l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(2, l_oStations.StationsAll.Count());
|
||||
filter = new FilteredConnector(new List<string> { FilterHelper.FILTERKONRAD }, connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(27, stations.StationsAll.Count());
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "AGroupNamedNonsensDoesNotExist" }, l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(0, l_oStations.StationsAll.Count());
|
||||
filter = new FilteredConnector(new List<string> { "AGroupNamedNonsensDoesNotExist" }, connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(0, stations.StationsAll.Count());
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string>(), l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(9, l_oStations.StationsAll.Count());
|
||||
filter = new FilteredConnector(new List<string>(), connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(41, stations.StationsAll.Count());
|
||||
|
||||
l_oFilter = new FilteredConnector(null, l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(9, l_oStations.StationsAll.Count(), "Null means filter none.");
|
||||
filter = new FilteredConnector(null, connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(41, stations.StationsAll.Count(), "Null means filter none.");
|
||||
}
|
||||
|
||||
/// <summary> Tests all stations. </summary>
|
||||
|
@ -52,19 +53,19 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
var l_oConnector = new ConnectorCache(
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory(CopriCallsMemory.SampleSets.Set2, 1));
|
||||
new CopriCallsMemory001());
|
||||
|
||||
var l_oFilter = new FilteredConnector(new List<string> { "TINK", "Konrad" }, l_oConnector);
|
||||
var l_oFilter = new FilteredConnector(new List<string> { FilterHelper.FILTERTINKGENERAL, FilterHelper.FILTERKONRAD }, l_oConnector);
|
||||
var l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(12, l_oBikes.Count());
|
||||
Assert.AreEqual(8, l_oBikes.Count()); // Count of stations was 12 CopriCallsMemory(CopriCallsMemory.SampleSets.Set2, 1)
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "TINK" }, l_oConnector);
|
||||
l_oFilter = new FilteredConnector(new List<string> { FilterHelper.FILTERTINKGENERAL }, l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(11, l_oBikes.Count());
|
||||
Assert.AreEqual(5, l_oBikes.Count()); // Was 11
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "Konrad" }, l_oConnector);
|
||||
l_oFilter = new FilteredConnector(new List<string> { FilterHelper.FILTERKONRAD }, l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(1, l_oBikes.Count());
|
||||
Assert.AreEqual(3, l_oBikes.Count()); // Was 1
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "AGroupNamedNonsensDoesNotExist" }, l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
|
@ -72,11 +73,11 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
|
||||
l_oFilter = new FilteredConnector(new List<string>(), l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(12, l_oBikes.Count(), "List with zero element means filter all.");
|
||||
Assert.AreEqual(8, l_oBikes.Count(), "List with zero element means filter all."); // Was 12
|
||||
|
||||
l_oFilter = new FilteredConnector(null, l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(12, l_oBikes.Count(), "Null means filter none.");
|
||||
Assert.AreEqual(8, l_oBikes.Count(), "Null means filter none.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -342,18 +342,21 @@ namespace TestTINKLib.Fixtures.Connector
|
|||
[Test]
|
||||
public void TestGetAuthGroup()
|
||||
{
|
||||
var l_oResponse = JsonConvertRethrow.DeserializeObject<AuthorizationResponse>(@"
|
||||
// User group was of format [ ""TINK"", ""Konrad"" ] in early day...
|
||||
// Since COPRI 4.1 use group is no more used.
|
||||
// Groups are of format <OperatorId>_<BikeType> for this user group would be like below if it would be used.
|
||||
var response = JsonConvertRethrow.DeserializeObject<AuthorizationResponse>(@"
|
||||
{
|
||||
""response"" : ""authorization"",
|
||||
""authcookie"" : ""4da3044c8657a04ba60e2eaa753bc51a"",
|
||||
""user_group"" : [ ""TINK"", ""Konrad"" ],
|
||||
""user_group"" : [ ""KN_300102"", ""KN_300101"" ],
|
||||
""response_state"" : ""OK"",
|
||||
""apiserver"" : ""https://tinkwwp.copri-bike.de""
|
||||
}");
|
||||
|
||||
Assert.AreEqual(2, l_oResponse.GetGroup().ToList().Count);
|
||||
Assert.AreEqual(FilterHelper.FILTERTINKGENERAL, l_oResponse.GetGroup().ToList()[0]);
|
||||
Assert.AreEqual("Konrad", l_oResponse.GetGroup().ToList()[1]);
|
||||
Assert.AreEqual(2, response.GetGroup().ToList().Count);
|
||||
Assert.AreEqual($"KN_300102", response.GetGroup().ToList()[0]);
|
||||
Assert.AreEqual($"KN_300101", response.GetGroup().ToList()[1]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using NUnit.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.ViewModel.Map;
|
||||
|
||||
namespace UITest.Fixtures.ObjectTests.Map
|
||||
|
@ -19,23 +19,23 @@ namespace UITest.Fixtures.ObjectTests.Map
|
|||
[Test]
|
||||
public void TestCurrentFilter()
|
||||
{
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }));
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.On }, { "Konrad", FilterState.Off } }));
|
||||
|
||||
Assert.AreEqual("TINK", l_oFilter.CurrentFilter);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERTINKGENERAL}", l_oFilter.CurrentFilter);
|
||||
|
||||
l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }));
|
||||
l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.Off }, { $"HOM_{ FilterHelper.FILTERKONRAD}", FilterState.On } }));
|
||||
|
||||
Assert.AreEqual("Konrad", l_oFilter.CurrentFilter);
|
||||
Assert.AreEqual($"HOM_{ FilterHelper.FILTERKONRAD}", l_oFilter.CurrentFilter);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestIsToggleVisible()
|
||||
{
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }));
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.On } }));
|
||||
|
||||
Assert.IsFalse(l_oFilter.IsToggleVisible);
|
||||
|
||||
l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }));
|
||||
l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.Off }, { $"HOM_{ FilterHelper.FILTERKONRAD}", FilterState.On } }));
|
||||
|
||||
Assert.IsTrue(l_oFilter.IsToggleVisible);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.ViewModel.Settings;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
||||
|
@ -12,12 +13,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
|||
[Test]
|
||||
public void TestDoFilter()
|
||||
{
|
||||
var l_oFilter = new GroupFilterSettings(new Dictionary<string, FilterState> { { "Konrad", FilterState.Off }, { "TINK", FilterState.On }, { "FutureBikeType", FilterState.On} });
|
||||
var l_oFilter = new GroupFilterSettings(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERKONRAD}", FilterState.Off }, { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.On }, { "HOM_117025", FilterState.On} });
|
||||
|
||||
var l_oResult = l_oFilter.DoFilter(new List<string> { "Konrad", "TINK" });
|
||||
var l_oResult = l_oFilter.DoFilter(new List<string> { $"HOM_{FilterHelper.FILTERKONRAD}", $"HOM_{FilterHelper.FILTERTINKGENERAL}" });
|
||||
|
||||
Assert.AreEqual(1, l_oResult.ToList().Count);
|
||||
Assert.AreEqual("TINK", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERTINKGENERAL}", l_oResult.ToList()[0]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,12 @@
|
|||
using NUnit.Framework;
|
||||
using Serilog.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Services.CopriApi.ServerUris;
|
||||
using TINK.Settings;
|
||||
using TINK.ViewModel.Map;
|
||||
using TINK.ViewModel.Settings;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
||||
{
|
||||
|
@ -17,9 +20,11 @@ namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
|||
|
||||
Assert.AreEqual(LogEventLevel.Error, settings.MinimumLogEventLevel);
|
||||
|
||||
Assert.AreEqual(GroupFilterHelper.GetSettingsFilterDefaults, settings.GroupFilterSettings);
|
||||
// Was GroupFilterHelper.GetSettingsFilterDefaults when used in TINK- context.
|
||||
Assert.AreEqual(new GroupFilterSettings(), settings.GroupFilterSettings);
|
||||
|
||||
Assert.AreEqual(GroupFilterHelper.GetMapPageFilterDefaults, settings.GroupFilterMapPage);
|
||||
// Was GroupFilterHelper.GetMapPageFilterDefaults when used in TINK- context.
|
||||
Assert.AreEqual(new GroupFilterMapPage(), settings.GroupFilterMapPage);
|
||||
|
||||
Assert.AreEqual(new CopriServerUriList().ActiveUri, settings.ActiveUri);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using Rhino.Mocks;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.User.Account;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.User.Account
|
||||
|
@ -17,16 +18,16 @@ namespace TestTINKLib.Fixtures.ObjectTests.User.Account
|
|||
|
||||
l_oAccount.Stub((x) => x.Mail).Return("a@b");
|
||||
l_oAccount.Stub((x) => x.SessionCookie).Return(""); // User is not logged in
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { "TINK", "FutureType" });
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { $"HOM_{FilterHelper.FILTERTINKGENERAL}", "HOM_117025" });
|
||||
|
||||
var l_oSource = new List<string> { "TINK", "Konrad", "FutureType" };
|
||||
var l_oSource = new List<string> { $"HOM_{FilterHelper.FILTERTINKGENERAL}", $"HOM_{FilterHelper.FILTERKONRAD}", "HOM_117025" };
|
||||
|
||||
var l_oResult = l_oAccount.DoFilter(l_oSource);
|
||||
|
||||
Assert.AreEqual(3, l_oResult.ToList().Count);
|
||||
Assert.AreEqual("TINK", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual("Konrad", l_oResult.ToList()[1]);
|
||||
Assert.AreEqual("FutureType", l_oResult.ToList()[2]);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERTINKGENERAL}", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERKONRAD}", l_oResult.ToList()[1]);
|
||||
Assert.AreEqual("HOM_117025", l_oResult.ToList()[2]);
|
||||
}
|
||||
/// <summary> </summary>
|
||||
[Test]
|
||||
|
@ -36,15 +37,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.User.Account
|
|||
|
||||
l_oAccount.Stub((x) => x.Mail).Return("a@b");
|
||||
l_oAccount.Stub((x) => x.SessionCookie).Return("123");
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { "TINK", "FutureType" });
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { $"HOM_{FilterHelper.FILTERTINKGENERAL}", "HOM_117025" });
|
||||
|
||||
var l_oSource = new List<string> { "TINK", "Konrad", "FutureType" };
|
||||
var l_oSource = new List<string> { $"HOM_{FilterHelper.FILTERTINKGENERAL}", $"HOM_{FilterHelper.FILTERKONRAD}", "HOM_117025" };
|
||||
|
||||
var l_oResult = l_oAccount.DoFilter(l_oSource);
|
||||
|
||||
Assert.AreEqual(2, l_oResult.ToList().Count);
|
||||
Assert.AreEqual("TINK", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual("FutureType", l_oResult.ToList()[1]);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERTINKGENERAL}", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual("HOM_117025", l_oResult.ToList()[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Model.User;
|
||||
using TINK.Model.Connector;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
|
||||
using TINK.Model.User.Account;
|
||||
using System.Collections.Generic;
|
||||
using TINK.Repository;
|
||||
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TestFramework.Model.User.Account;
|
||||
|
||||
namespace TestTINKLib
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
@ -101,7 +104,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);
|
||||
}
|
||||
|
@ -118,8 +121,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(),
|
||||
|
@ -140,7 +143,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);
|
||||
}
|
||||
|
@ -157,8 +160,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(),
|
||||
|
@ -179,7 +182,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);
|
||||
}
|
||||
|
@ -196,7 +199,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",
|
||||
|
@ -207,7 +210,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(),
|
||||
|
@ -229,7 +232,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);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
using Rhino.Mocks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TINK.Model.Bike.BluetoothLock;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.State;
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
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;
|
||||
using TINK.Model.Services.CopriApi;
|
||||
using TINK.Repository;
|
||||
using TINK.View;
|
||||
using TINK.ViewModel.Map;
|
||||
using Xamarin.Forms;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TINK.ViewModel.Settings;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Services;
|
||||
using NSubstitute;
|
||||
using TINK.Services.Permissions;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Services.Permissions;
|
||||
using TestFramework.Repository;
|
||||
using TestFramework.Services.CopriApi.Connector;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.Startup
|
||||
namespace TestShareeLib.UseCases.Startup
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
|
@ -34,15 +34,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -55,8 +55,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
lastVersion: new Version(3, 0, 173), // Current app version. Must be larger or equal 3.0.173 to
|
||||
whatsNewShownInVersion: null); // Whats new page was never shown.
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -77,13 +77,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(21, viewModel.Pins.Count); // Were 8 pins when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag,
|
||||
Is.EqualTo("FR105"),
|
||||
"Station FR105 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag,
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike."); // Was station id 31
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
|
||||
|
@ -109,15 +111,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.Off }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -130,8 +132,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
lastVersion: new Version(3, 0, 173), // Current app version. Must be larger or equal 3.0.173 to
|
||||
whatsNewShownInVersion: null); // Whats new page was never shown.
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -152,13 +154,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(2, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Green"),
|
||||
"Station 5 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "14").Icon.Id.Contains("Red"),
|
||||
"Station 14 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(27, viewModel.Pins.Count); // Were 2 pins when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag, // Was station 5
|
||||
Is.EqualTo("FR101"),
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was station 14
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
|
||||
|
@ -176,22 +180,20 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
public async Task TestConstruct_KonradOnly()
|
||||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.Off }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -202,8 +204,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
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
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -211,8 +213,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -224,13 +226,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(2, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Green"),
|
||||
"Station 5 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "14").Icon.Id.Contains("Red"),
|
||||
"Station 14 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(27, viewModel.Pins.Count); // Were 2 when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag, // Was station id 31
|
||||
Is.EqualTo("FR101"),
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was 14
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsFalse(viewModel.IsToggleVisible, "TINK and Konrad is deactivated from settings.");
|
||||
|
@ -250,15 +254,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001( sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -269,8 +273,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173));
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -278,8 +282,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -291,13 +295,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(21, viewModel.Pins.Count); // Were 8 pin when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag,
|
||||
Is.EqualTo("FR103"), // Was station id 4
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was 31
|
||||
Is.EqualTo("KN12"), // Was station id 31
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsFalse(viewModel.IsToggleVisible, "TINK and Konrad is deactivated from settings.");
|
||||
|
@ -317,15 +323,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001( sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -336,8 +342,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
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
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -345,8 +351,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -358,13 +364,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(21, viewModel.Pins.Count); // Were 8 pins when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag, // Was station id 4
|
||||
Is.EqualTo("FR103"),
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was 31
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
|
||||
|
@ -386,8 +394,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -405,7 +413,7 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new WebConnectFailureException(msg, new Exception("Source expection."))))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
|
@ -417,8 +425,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
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
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -426,8 +434,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -441,13 +449,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
viewModel.Exception.Message);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(21, viewModel.Pins.Count);
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag, // Was station id 4
|
||||
Is.EqualTo("FR103"),
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was 31
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
|
||||
|
@ -463,14 +473,13 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public async Task TestConstruct_GeneralPurposeCommunicationError()
|
||||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -488,7 +497,7 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new Exception(msg)))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
|
@ -501,8 +510,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -510,8 +519,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -525,12 +534,14 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
viewModel.Exception.Message);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
Assert.AreEqual(21, viewModel.Pins.Count);
|
||||
Assert.That(
|
||||
viewModel.Pins.Where(pin => pin.Icon.Id.Contains("Open_Green")).Select(pin => pin.Tag.ToString()),
|
||||
Does.Contain("FR103"), // Was station id 4
|
||||
"Station FR103 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.Where(pin => pin.Icon.Id.Contains("Open_Red")).Select(pin => pin.Tag.ToString()),
|
||||
Does.Contain("KN12"), // Was station id 31
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
|
|
|
@ -4,7 +4,6 @@ using TINK.Model.Bike;
|
|||
using TINK.Model.User;
|
||||
using TINK.Model.User.Account;
|
||||
using TINK.ViewModel;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using TINK.Model.State;
|
||||
|
@ -14,6 +13,7 @@ using System.Collections.Generic;
|
|||
using BikeInfoMutable = TINK.Model.Bike.BC.BikeInfoMutable;
|
||||
using TINK.ViewModel.Bikes;
|
||||
using TINK.Model.Device;
|
||||
using TestFramework.Model.User.Account;
|
||||
|
||||
namespace UITest.Fixtures.ViewModel
|
||||
{
|
||||
|
|
|
@ -3,13 +3,12 @@ using System;
|
|||
using TINK.Model.Bike;
|
||||
using TINK.Model.User;
|
||||
using TINK.Model.User.Account;
|
||||
using TINK.ViewModel;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TINK.Model.State;
|
||||
using System.Collections.Generic;
|
||||
using TINK.Repository;
|
||||
using TINK.ViewModel.Bikes.Bike;
|
||||
using TestFramework.Model.User.Account;
|
||||
|
||||
namespace UITest.Fixtures.ViewModel
|
||||
{
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using System;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.User;
|
||||
using TINK.ViewModel;
|
||||
|
|
|
@ -3,10 +3,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
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;
|
||||
|
@ -28,6 +24,12 @@ using TINK.Model.Services.Geolocation;
|
|||
using NSubstitute.ExceptionExtensions;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Device;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Repository;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.Permissions;
|
||||
using TestFramework.Services.CopriApi.Connector;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
||||
{
|
||||
|
@ -46,15 +48,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: locksService.GetType().FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("", null, null, new List<string> ())),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.ShareeFr01_Set1, 1, sessionCookie)),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("", null, null, new List<string>())),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
geolocation,
|
||||
locksService,
|
||||
new DeviceMock(),
|
||||
|
@ -72,7 +74,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.Android,
|
||||
new TINK.Model.Station.Station("103", new List<string>(), null), // Station 103
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 103 before switching from data provider CopriCallsMemory(SampleSets.ShareeFr01_Set1, 1, ...)
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
geolocation.Active, // geolocation
|
||||
|
@ -92,13 +94,13 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
var bike1315 = bikesAtStation.FirstOrDefault(x => x.Id == "1315") as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
|
||||
var bike1543 = bikesAtStation.FirstOrDefault(x => x.Id == "1543") as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
|
||||
var bikeFR9999 = bikesAtStation.FirstOrDefault(x => x.Id == "FR9999") as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel; // Was id 1315
|
||||
var bikeFR9998 = bikesAtStation.FirstOrDefault(x => x.Id == "FR9998") as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel; // Was id 1543
|
||||
|
||||
Assert.AreEqual("Available.", bike1315.StateText);
|
||||
Assert.AreEqual("Available.", bike1543.StateText);
|
||||
Assert.AreEqual("NotLoggedIn", bike1315.LockitButtonText);
|
||||
Assert.AreEqual("NotLoggedIn", bike1543.LockitButtonText);
|
||||
Assert.AreEqual("Available.", bikeFR9999.StateText);
|
||||
Assert.AreEqual("Available.", bikeFR9998.StateText);
|
||||
Assert.AreEqual("NotLoggedIn", bikeFR9999.LockitButtonText);
|
||||
Assert.AreEqual("NotLoggedIn", bikeFR9998.LockitButtonText);
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -118,8 +120,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -195,8 +197,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -296,8 +298,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -403,8 +405,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -507,8 +509,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -609,8 +611,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -703,15 +705,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.Off }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000),true),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: locksService.GetType().FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
new DeviceMock(),
|
||||
|
@ -729,7 +731,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("31", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR101", new List<string>(), null), // Was 31 before switching CopriCallsMemory(SampleSets.Set2, 1, ...)
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -745,11 +747,13 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.IsTrue(new List<string> { "Updating...", string.Empty }.Contains(bikesAtStation.StatusInfoText));
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(1, bikesAtStation.Count);
|
||||
Assert.AreEqual(3, bikesAtStation.Count); // Was 1 before switch.
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "52").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1003").StateText); // Was 52 before switch.
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1002").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1001").StateText);
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -774,8 +778,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.Off }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -842,19 +846,19 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: locksService.GetType().FullName,
|
||||
activeGeolocationService: locksService.GetType().FullName),
|
||||
new StoreMock(new TINK.Model.User.Account.Account(
|
||||
LoginSessionCopriInfo.JavaministerHardwareNr1.Mail,
|
||||
LoginSessionCopriInfo.JavaministerHardwareNr1.Mail,
|
||||
LoginSessionCopriInfo.JavaministerHardwareNr1.Pwd,
|
||||
"4da3044c8657a04ba60e2eaa753bc51a",
|
||||
new List<string> { "TINK" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
"6103_112e96b36ba33de245943c5ffaf369cd_", // Was 4da3044c8657a04ba60e2eaa753bc51a before switching from data provider CopriCallsMemory(SampleSets.Set2, 1, ...)
|
||||
new List<string> { FilterHelper.FILTERTINKGENERAL })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
new DeviceMock(),
|
||||
|
@ -872,7 +876,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("4", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 4 before switching from data provider CopriCallsMemory(SampleSets.Set2, 1, ...)
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -888,14 +892,14 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.IsTrue(new List<string> { "Updating...", string.Empty }.Contains(bikesAtStation.StatusInfoText));
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(4, bikesAtStation.Count);
|
||||
Assert.AreEqual(4, bikesAtStation.Count); // Count of bikes was 4 before switching from data provider CopriCallsMemory(SampleSets.Set2, 1, ...)
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "5").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "14").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "26").StateText);
|
||||
Assert.AreEqual("Code 2931, rented since 28. November 13:06.", bikesAtStation.FirstOrDefault(x => x.Id == "7").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText);
|
||||
Assert.AreEqual("Max. reservation time of 15 minutes expired.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1004").StateText);
|
||||
Assert.AreEqual("Rented since 06. November 18:57.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1544").StateText); // Was 7
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsFalse(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -919,15 +923,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: locksService.GetType().FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
new DeviceMock(),
|
||||
|
@ -945,7 +949,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("4", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 4 before switching from data provider CopriCallsMemory(SampleSets.Set2, 1
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -961,13 +965,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.AreEqual("Offline.", bikesAtStation.StatusInfoText);
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(3, bikesAtStation.Count);
|
||||
Assert.AreEqual(2, bikesAtStation.Count); // Count of bikes was 3. There is no more bike with id 26.
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "5").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "14").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "26").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText); // Was id 5
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9998").StateText); // Was is 14
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -991,8 +994,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -1009,7 +1012,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new WebConnectFailureException(msg, new Exception("Source expection."))))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
|
@ -1028,7 +1031,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("4", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 4 before switching from data provider CopriCallsCacheMemory()
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -1047,13 +1050,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.AreEqual("Connection interrupted, server unreachable.", bikesAtStation.StatusInfoText);
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(3, bikesAtStation.Count);
|
||||
Assert.AreEqual(2, bikesAtStation.Count); // Count of bikes was 3. There is no more bike with id 26.
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "5").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "14").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "26").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText); // Was id 5
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9998").StateText); // Was is 14
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -1077,8 +1079,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000),
|
||||
true),
|
||||
|
@ -1096,7 +1098,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new Exception(msg)))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
|
@ -1115,7 +1117,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("4", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 4 before switching from data provider CopriCallsCacheMemory()
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -1134,13 +1136,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.AreEqual("Connection interrupted.", bikesAtStation.StatusInfoText);
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(3, bikesAtStation.Count);
|
||||
Assert.AreEqual(2, bikesAtStation.Count); // Count of bikes was 3. There is no more bike with id 26.
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "5").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "14").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "26").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText); // Was id 5
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9998").StateText); // Was id 14.
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
|
|
@ -4,9 +4,6 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
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;
|
||||
|
@ -27,6 +24,11 @@ using TINK.Model.Services.Geolocation;
|
|||
using NSubstitute.ExceptionExtensions;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Device;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Repository;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.Permissions;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
||||
{
|
||||
|
@ -607,7 +609,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var myBikes = new MyBikesPageViewModel(
|
||||
tinkApp.ActiveUser,
|
||||
null, // Permissions,
|
||||
permissions, // Permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
() => tinkApp.GetIsConnected(),
|
||||
|
@ -682,7 +684,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var myBikes = new MyBikesPageViewModel(
|
||||
tinkApp.ActiveUser,
|
||||
null, // Permissions,
|
||||
permissions, // Permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
() => tinkApp.GetIsConnected(),
|
||||
|
@ -760,7 +762,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var myBikes = new MyBikesPageViewModel(
|
||||
tinkApp.ActiveUser,
|
||||
null, // Permissions,
|
||||
permissions, // Permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
() => tinkApp.GetIsConnected(),
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
using System;
|
||||
using TINK.Model;
|
||||
using TINK.Repository;
|
||||
using TestFramework.Model.Device;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
|
||||
{
|
||||
using NSubstitute;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Services.Permissions;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Services;
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Model;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TINK.Model.Connector;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using System;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using System.Collections.Generic;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TINK.Repository;
|
||||
using TINK.ViewModel.Settings;
|
||||
using NSubstitute;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Services.Permissions;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.SelectStation
|
||||
{
|
||||
|
|
|
@ -1,386 +0,0 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Model;
|
||||
|
||||
using TINK.Model.User.Account;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TINK.Model.Connector;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using System;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Bike;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TINK.Model.State;
|
||||
using System.Collections.Generic;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TINK.Repository;
|
||||
using TINK.ViewModel.Map;
|
||||
using TINK.ViewModel.Settings;
|
||||
using NSubstitute;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.Startup
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestTinkApp
|
||||
{
|
||||
[Test]
|
||||
public void NotLoggedIn()
|
||||
{
|
||||
var l_oConnector = new ConnectorCache(
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory(SampleSets.Set2, 1));
|
||||
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
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
|
||||
|
||||
var l_oStations = l_oTinkApp.GetConnector(true).Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
||||
// Check stations.
|
||||
Assert.AreEqual(8, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("4"));
|
||||
Assert.AreEqual("4", l_oStations.StationsAll.GetById("4").Id);
|
||||
Assert.AreEqual(new Position(47.6586936667, 9.16863116667), l_oStations.StationsAll.GetById("4").Position);
|
||||
|
||||
// Verify selected station.
|
||||
Assert.AreEqual(
|
||||
null,
|
||||
l_oTinkApp.SelectedStation.Id,
|
||||
"When starting app selected station must always be invlid");
|
||||
|
||||
// Verify bikes at station.
|
||||
Assert.AreEqual(
|
||||
0,
|
||||
TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.Count,
|
||||
"If no station is selected BikesAtStation- list count must be zero");
|
||||
|
||||
// Check my bikes.
|
||||
Assert.IsFalse(l_oTinkApp.ActiveUser.IsLoggedIn);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LoggedIn_BikesReservedBooked()
|
||||
{
|
||||
var l_oConnector = new ConnectorCache(
|
||||
"4da3044c8657a04ba60e2eaa753bc51a",
|
||||
"javaminister@gmail.com",
|
||||
new CopriCallsMemory(SampleSets.Set2, 1, "4da3044c8657a04ba60e2eaa753bc51a"));
|
||||
|
||||
// User logged in is initial state to verify.
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"), new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new Account("javaminister@gmail.com", "javaminister" /* password */, "4da3044c8657a04ba60e2eaa753bc51a" /* session cookie */, new List<string> { "TINK", "Konrad" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, "4da3044c8657a04ba60e2eaa753bc51a")),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
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
|
||||
|
||||
var l_oStations = l_oTinkApp.GetConnector(true).Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
||||
// Check stations.
|
||||
Assert.AreEqual(8, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("4"));
|
||||
Assert.AreEqual("4", l_oStations.StationsAll.GetById("4").Id);
|
||||
Assert.AreEqual(new Position(47.6586936667, 9.16863116667), l_oStations.StationsAll.GetById("4").Position);
|
||||
|
||||
// Verify selected station.
|
||||
Assert.AreEqual(
|
||||
null,
|
||||
l_oTinkApp.SelectedStation.Id,
|
||||
"When starting app selected station must always be invlid");
|
||||
|
||||
// Verify bikes at station.
|
||||
Assert.AreEqual(
|
||||
0,
|
||||
TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.Count,
|
||||
"If no station is selected BikesAtStation- list count must be zero");
|
||||
|
||||
// Check my bikes
|
||||
var l_oBikes = l_oTinkApp.GetConnector(true).Query.GetBikesOccupiedAsync().Result.Response;
|
||||
Assert.AreEqual(2, l_oBikes.Count);
|
||||
Assert.AreEqual("8", l_oBikes.GetById("8").Id);
|
||||
Assert.AreEqual(InUseStateEnum.Booked, l_oBikes.GetById("8").State.Value);
|
||||
Assert.AreEqual("5", l_oBikes.GetById("8").CurrentStation);
|
||||
Assert.AreEqual(TypeOfBike.Cargo, l_oBikes.GetById("8").TypeOfBike);
|
||||
Assert.AreEqual(WheelType.Two, l_oBikes.GetById("8").WheelType);
|
||||
Assert.AreEqual("7", l_oBikes.GetById("7").Id);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LoggedIn_AllBikesDisposable_FilterTINK()
|
||||
{
|
||||
var l_oConnector = new ConnectorCache(
|
||||
"1234",
|
||||
"mgrimm@gmail.com",
|
||||
new CopriCallsMemory(SampleSets.Set2, 1));
|
||||
|
||||
// No user logged in is initial state to verify.
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new Uri("https://app.tink-konstanz.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new Account("mgrimm@gmail.com", "123456789" /* password */, "1234" /* session cookie */, new List<string> { "TINK", "Konrad" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
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
|
||||
|
||||
var l_oStations = l_oTinkApp.GetConnector(true).Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
||||
// Check stations.
|
||||
Assert.AreEqual(8, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("4"));
|
||||
Assert.AreEqual("4", l_oStations.StationsAll.GetById("4").Id);
|
||||
Assert.AreEqual(new Position(47.6586936667, 9.16863116667), l_oStations.StationsAll.GetById("4").Position);
|
||||
|
||||
// Verify selected station.
|
||||
Assert.AreEqual(
|
||||
null,
|
||||
l_oTinkApp.SelectedStation.Id,
|
||||
"When starting app selected station must always be invlid");
|
||||
|
||||
// Verify bikes at station.
|
||||
Assert.AreEqual(
|
||||
0,
|
||||
TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.Count,
|
||||
"If no station is selected BikesAtStation- list count must be zero");
|
||||
|
||||
// Check my bikes
|
||||
Assert.IsTrue(l_oTinkApp.ActiveUser.IsLoggedIn);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LoggedIn_AllBikesDisposable_FilterKonrad()
|
||||
{
|
||||
var l_oCopriServer = new CopriCallsMemory(SampleSets.Set2, 1);
|
||||
var l_oConnector = new ConnectorCache(
|
||||
"1234",
|
||||
"mgrimm@gmail.com",
|
||||
new CopriCallsMemory(SampleSets.Set2, 1));
|
||||
|
||||
// No user logged in is initial state to verify.
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new Uri("https://app.tink-konstanz.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new Account("mgrimm@gmail.com", "123456789" /* password */, "1234" /* session cookie */, new List<string> { "TINK", "Konrad" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
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
|
||||
|
||||
var l_oStations = l_oTinkApp.GetConnector(true).Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
||||
// Check stations.
|
||||
Assert.AreEqual(2, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("14"));
|
||||
Assert.AreEqual("14", l_oStations.StationsAll.GetById("14").Id);
|
||||
Assert.AreEqual(new Position(47.66698054007847, 9.169303178787231), l_oStations.StationsAll.GetById("14").Position);
|
||||
|
||||
// Verify selected station.
|
||||
Assert.AreEqual(
|
||||
null,
|
||||
l_oTinkApp.SelectedStation.Id,
|
||||
"When starting app selected station must always be invlid");
|
||||
|
||||
// Verify bikes at station.
|
||||
Assert.AreEqual(
|
||||
0,
|
||||
TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.Count,
|
||||
"If no station is selected BikesAtStation- list count must be zero");
|
||||
|
||||
// Check my bikes
|
||||
Assert.IsTrue(l_oTinkApp.ActiveUser.IsLoggedIn);
|
||||
}
|
||||
|
||||
[Test, Ignore("Todo: Check if reserved bikes are released even if system is offline.")]
|
||||
public void LoggedIn_BikesReserved_OfflineAfterStart()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test if Whats New logic works as expected. Form version 3.0.0.115 or smaller no Whats New dialog existed.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void FirstInstall_WhatsNew()
|
||||
{
|
||||
var l_oAppVersion = new Version(3, 2, 0, 120);
|
||||
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
null, // use default locks service
|
||||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
#if ARENDI
|
||||
Substitute.For<ICentral>(),
|
||||
#endif
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: l_oAppVersion, // Current app version
|
||||
lastVersion: null, // Last version.
|
||||
whatsNewShownInVersion: null); // First install.
|
||||
|
||||
// Whats new page
|
||||
Assert.IsFalse(
|
||||
l_oTinkApp.WhatsNew.IsShowRequired,
|
||||
$"Whats new should not be displayed because first install has been detected.");
|
||||
|
||||
// Call member which view model calls when using app.
|
||||
l_oTinkApp.SetWhatsNewWasShown();
|
||||
|
||||
// Whats new page
|
||||
Assert.IsFalse(
|
||||
l_oTinkApp.WhatsNew.IsShowRequired,
|
||||
$"Whats new should mot be displayed first install detected.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Upgrade120_WhatsNew()
|
||||
{
|
||||
var l_oAppVersion = new Version(3, 0, 0, 120);
|
||||
Version lastVersion = new Version(3, 0, 0, 116);
|
||||
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
null, // use default locks service
|
||||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
#if ARENDI // Requires LockItArendi library.
|
||||
Substitute.For<ICentral>(),
|
||||
#endif
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: l_oAppVersion, // Current app version
|
||||
lastVersion: lastVersion,
|
||||
whatsNewShownInVersion: null); // Whats new page was never shown.
|
||||
|
||||
// Whats new page
|
||||
Assert.IsTrue(
|
||||
l_oTinkApp.WhatsNew.IsShowRequired,
|
||||
$"Whats new should be displayed because app version is {l_oAppVersion} and version when \"Whats New\" was shown last is {lastVersion} (null means never).");
|
||||
|
||||
// Call member which view model calls when using app.
|
||||
l_oTinkApp.SetWhatsNewWasShown();
|
||||
|
||||
// Whats new page
|
||||
Assert.IsFalse(
|
||||
l_oTinkApp.WhatsNew.IsShowRequired,
|
||||
$"Whats new should mot be displayed because app version is {l_oAppVersion} and version when \"Whats New\" was shown last is {lastVersion} equals.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SubsequentStart_WhatsNew()
|
||||
{
|
||||
var l_oAppVersion = new Version(3, 2, 0, 115);
|
||||
var l_oWhatsNewVersion = new Version(3, 2, 0, 115);
|
||||
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(TINK.Services.BluetoothLock.BLE.LockItByGuidService).FullName,
|
||||
activeGeolocationService: typeof(TINK.Model.Services.Geolocation.LastKnownGeolocationService).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
null, // use default locks service
|
||||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
#if ARENDI // Requires LockItArendi library.
|
||||
Substitute.For<ICentral>(),
|
||||
#endif
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: l_oAppVersion, // Current app version<
|
||||
lastVersion: l_oWhatsNewVersion); // Whats new page was never shown.
|
||||
|
||||
// Whats new page
|
||||
Assert.IsFalse(
|
||||
l_oTinkApp.WhatsNew.IsShowRequired,
|
||||
$"Whats new should not be displayed because app version is {l_oAppVersion} and version when \"Whats New\" was shown last is {l_oWhatsNewVersion} equals.");
|
||||
|
||||
// Call member which view model would call if Whats New would have been shonw.
|
||||
l_oTinkApp.SetWhatsNewWasShown();
|
||||
|
||||
// Whats new page
|
||||
Assert.IsFalse(
|
||||
l_oTinkApp.WhatsNew.IsShowRequired,
|
||||
$"Whats new should mot be displayed because app version is {l_oAppVersion} and version when \"Whats New\" was shown last is {l_oWhatsNewVersion} equals.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Repository;
|
||||
using TINK.Repository.Request;
|
||||
using TINK.Repository.Response;
|
||||
|
||||
namespace TestTINKLib.Mocks.Connector
|
||||
{
|
||||
/// <summary> Simulates communication errors when connecting to copri.</summary>
|
||||
public class ExceptionServer : ICopriServer
|
||||
{
|
||||
private Func<string, Exception> ExceptionFactory { get; }
|
||||
|
||||
/// <summary> Constructs object.</summary>
|
||||
/// <param name="exceptionFactory"> Provides exceptions which are thrown whenn querrying information from server.</param>
|
||||
public ExceptionServer(Func<string, Exception> exceptionFactory)
|
||||
{
|
||||
ExceptionFactory = exceptionFactory;
|
||||
}
|
||||
|
||||
public bool IsConnected => true;
|
||||
|
||||
public string SessionCookie => string.Empty;
|
||||
|
||||
public string MerchantId => string.Empty;
|
||||
|
||||
public Task<AuthorizationResponse> DoAuthorizationAsync(string p_strMailAddress, string p_strPassword, string p_strDeviceId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<AuthorizationoutResponse> DoAuthoutAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ReservationBookingResponse> DoReserveAsync(string bikeId, Uri operatorUri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ReservationCancelReturnResponse> DoCancelReservationAsync(string p_iBikeId, Uri operatorUri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ReservationBookingResponse> CalculateAuthKeysAsync(string bikeId, Uri operatorUri)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
public Task<ReservationBookingResponse> UpdateLockingStateAsync(string bikeId, LocationDto geolocation, lock_state state, double batteryPercentage, Uri operatorUri)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ReservationCancelReturnResponse> DoReturn(string bikeId, LocationDto location, ISmartDevice smartDevice, Uri operatorUri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<SubmitFeedbackResponse> DoSubmitFeedback(string bikeId, string message, bool isBikeBroken, Uri operatorUri)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
/// <summary> Submits mini survey to copri server. </summary>
|
||||
/// <param name="answers">Collection of answers.</param>
|
||||
public Task<ResponseBase> DoSubmitMiniSurvey(IDictionary<string, string> answers)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
public Task<BikesAvailableResponse> GetBikesAvailableAsync()
|
||||
{
|
||||
throw ExceptionFactory($"Simulated error thrown at {nameof(GetBikesAvailableAsync)}.");
|
||||
}
|
||||
|
||||
public Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
|
||||
{
|
||||
throw ExceptionFactory($"Simulated error thrown at {nameof(GetBikesOccupiedAsync)}.");
|
||||
}
|
||||
|
||||
public Task<StationsAvailableResponse> GetStationsAsync()
|
||||
{
|
||||
throw ExceptionFactory($"Simulated error thrown at {nameof(GetStationsAsync)}.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
using TINK.Model.Device;
|
||||
|
||||
namespace TestTINKLib.Mocks.Device
|
||||
{
|
||||
public class DeviceMock : ISmartDevice
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds the id of the device.
|
||||
/// </summary>
|
||||
private string m_strDeviceId = "522c6ff6886198fd";
|
||||
|
||||
public string Manufacturer => throw new System.NotImplementedException();
|
||||
|
||||
public string Model => throw new System.NotImplementedException();
|
||||
|
||||
public string PlatformText => throw new System.NotImplementedException();
|
||||
|
||||
public string VersionText => throw new System.NotImplementedException();
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a device mock object setting device id to default value.
|
||||
/// </summary>
|
||||
public DeviceMock()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a device mock object.
|
||||
/// </summary>
|
||||
/// <param name="p_strDeviceId">Mocked Id</param>
|
||||
public DeviceMock(string p_strDeviceId)
|
||||
{
|
||||
m_strDeviceId = p_strDeviceId;
|
||||
}
|
||||
|
||||
/// <summary> Gets the device ID.</summary>
|
||||
/// <returns></returns>
|
||||
public string Identifier
|
||||
=> m_strDeviceId;
|
||||
|
||||
/// <summary> Close the application. </summary>
|
||||
public void CloseApplication()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
using TINK.Model.Device;
|
||||
|
||||
namespace TestTINKLib.Mocks.Device
|
||||
{
|
||||
public class SpecialFolderMock : ISpecialFolder
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the folder name of external folder to write to.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetExternalFilesDir()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// <summary> Gets the folder name of the personal data folder dir on internal storage. </summary>
|
||||
/// <returns>Directory name.</returns>
|
||||
public string GetInternalPersonalDir()
|
||||
{
|
||||
return System.IO.Path.GetTempPath();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TestTINKLib.Mocks.Services
|
||||
{
|
||||
public class GeolocationMock : IGeolocation
|
||||
{
|
||||
|
||||
public Task<Location> GetAsync(CancellationToken? cancelToken = null, DateTime? timeStamp = null)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary> If true location data returned is simulated.</summary>
|
||||
public bool IsSimulation { get => true; }
|
||||
|
||||
public bool IsGeolcationEnabled => true;
|
||||
}
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Model.Bike;
|
||||
using TINK.Model.Bike.BluetoothLock;
|
||||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Services.BluetoothLock.Tdo;
|
||||
|
||||
namespace TestTINKLib.Mocks.Services
|
||||
{
|
||||
public class LocksServiceMock : ILocksService
|
||||
{
|
||||
/// <param name="connectTimeout">Timeout for connect operation of a single lock.</param>
|
||||
public async Task<IEnumerable<LockInfoTdo>> GetLocksStateAsync(IEnumerable<LockInfoAuthTdo> locksInfo, TimeSpan connectTimeout)
|
||||
{
|
||||
return await Task.FromResult(new List<LockInfoTdo>());
|
||||
}
|
||||
|
||||
/// <summary> Holds timeout values for series of connecting attemps to a lock or multiple locks. </summary>
|
||||
public ITimeOutProvider TimeOut { get; set; }
|
||||
|
||||
public void UpdateSimulation(BikeCollection bikes) {}
|
||||
|
||||
/// <summary> Opens lock.</summary>
|
||||
/// <param name="bike">Bike object to update.</param>
|
||||
public async Task<LockitLockingState?> OpenAsync(int lockId, byte[] copriKey) => await Task.FromResult(LockitLockingState.Open);
|
||||
|
||||
/// <summary> Closes lock.</summary>
|
||||
/// <param name="bike">Bike object to update.</param>
|
||||
public async Task<LockitLockingState?> CloseAsync(int lockId, byte[] copriKey) => await Task.FromResult(LockitLockingState.Closed);
|
||||
|
||||
/// <summary> Gets the state of a bike. </summary>
|
||||
/// <param name="lockId">Id of lockId to get state for.</param>
|
||||
/// <returns></returns>
|
||||
public async Task<LockitLockingState?> GetState(string lockId) => await Task.FromResult((LockitLockingState?)null);
|
||||
|
||||
/// <summary> Connects to lock.</summary>
|
||||
/// <param name="authInfo"> Info required to connect to lock.</param>
|
||||
/// <param name="connectTimeout">Timeout for connect operation.</param>
|
||||
public async Task<LockInfoTdo> ConnectAsync(LockInfoAuthTdo authInfo, TimeSpan connectTimeout)
|
||||
{
|
||||
return await Task.FromResult(new LockInfoTdo.Builder { Id = 12, Guid = new System.Guid("00000000-0000-0000-0000-000000000042"), State = null }.Build());
|
||||
}
|
||||
|
||||
/// <summary> Set sound settings.</summary>
|
||||
/// <param name="lockId">Id of lock to set sound settings.</param>
|
||||
public async Task<bool> SetSoundAsync(int lockId, SoundSettings settings)
|
||||
{
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary> Gets battery percentage.</summary>
|
||||
/// <param name="lockId">Id of lock to get info for.</param>
|
||||
public Task<double> GetBatteryPercentageAsync(int lockId)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary> Sets whether alarm is on or off.</summary>
|
||||
/// <param name="lockId">Id of lock to get info from.</param>
|
||||
public async Task SetIsAlarmOffAsync(int lockId, bool activated)
|
||||
{
|
||||
await Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary> Gets whether alarm is on or off.</summary>
|
||||
/// <param name="lockId">Id of lock to get info for.</param>
|
||||
public async Task<bool> GetIsAlarmOffAsync(int lockId)
|
||||
{
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary>Gets a lock by bike Id.</summary>
|
||||
/// <param name="bikeId"></param>
|
||||
/// <returns>Lock object</returns>
|
||||
public ILockService this[int bikeId]
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Task<LockingState> DisconnectAsync(int bikeId, Guid bikeGuid) => throw new NotSupportedException();
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
using Plugin.Permissions;
|
||||
using Plugin.Permissions.Abstractions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TestTINKLib.Mocks.Services
|
||||
{
|
||||
public class PermissionsMock : IPermissions
|
||||
{
|
||||
public async Task<PermissionStatus> CheckPermissionStatusAsync<T>() where T : BasePermission, new()
|
||||
{
|
||||
return await Task.FromResult(Plugin.Permissions.Abstractions.PermissionStatus.Granted);
|
||||
}
|
||||
|
||||
public Task<PermissionStatus> CheckPermissionStatusAsync(Permission permission)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool OpenAppSettings()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<PermissionStatus> RequestPermissionAsync<T>() where T : BasePermission, new()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<Dictionary<Permission, PermissionStatus>> RequestPermissionsAsync(params Permission[] permissions)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> ShouldShowRequestPermissionRationaleAsync(Permission permission)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
using TINK.Model.User.Account;
|
||||
|
||||
namespace TestTINKLib.Model.User.Account
|
||||
{
|
||||
public class StoreMock : IStore
|
||||
{
|
||||
IAccount m_oAccount;
|
||||
|
||||
/// <summary>
|
||||
/// Instantiates
|
||||
/// - a dummy account to simulate a logged in user before end of last session
|
||||
/// - an empty account to simulate no user logged in before end of last session
|
||||
/// </summary>
|
||||
/// <param name="p_oAccount">If null no user is logged in.</param>
|
||||
public StoreMock(IAccount p_oAccount = null)
|
||||
{
|
||||
m_oAccount = new TINK.Model.User.Account.Account(p_oAccount ?? new EmptyAccount());
|
||||
}
|
||||
|
||||
public Task<IAccount> Load()
|
||||
{
|
||||
return Task.FromResult<IAccount>(new TINK.Model.User.Account.Account(m_oAccount));
|
||||
}
|
||||
|
||||
public IAccount Delete(IAccount p_oAccount)
|
||||
{
|
||||
// Set member to empty.
|
||||
m_oAccount = new EmptyAccount();
|
||||
|
||||
// Return empty account.
|
||||
return new EmptyAccount();
|
||||
}
|
||||
|
||||
public Task Save(IAccount p_oAccount)
|
||||
{
|
||||
m_oAccount = new TINK.Model.User.Account.Account(p_oAccount);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>TestTINKLib</RootNamespace>
|
||||
<AssemblyName>TestTINKLib</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
|
@ -103,6 +103,7 @@
|
|||
<Compile Include="Fixtures\ObjectTests\ViewModel\CopriWebView\TestPasswordForgottonViewModel.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Info\TestInfoViewModel.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Map\TestMapPageFilter.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Map\TestMapPageViewModel.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Settings\TestFilterCollectionMutable.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\TestBikeAtStationInUseStateInfoProvider.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\TestBikeAtStationViewModel.cs" />
|
||||
|
@ -114,7 +115,6 @@
|
|||
<Compile Include="Fixtures\ObjectTests\ViewModel\TestMyBikesPageViewModel.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\TestViewModelHelper.cs" />
|
||||
<Compile Include="Fixtures\UseCases\ConnectedOffline\TestTinkApp.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Map\TestMapPageViewModel.cs" />
|
||||
<Compile Include="Fixtures\UseCases\TestHelper.cs" />
|
||||
<Compile Include="LoginSessionCopriInfo.cs" />
|
||||
<None Include="Fixtures\ObjectTests\Bike\TestBikeSerializeJSON.cs" />
|
||||
|
@ -137,19 +137,11 @@
|
|||
<Compile Include="Fixtures\ObjectTests\State\TestStateRequestedInfoSerializeJSON.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\Station\TestStation.cs" />
|
||||
<Compile Include="Fixtures\UseCases\SelectStation\TestTinkApp.cs" />
|
||||
<Compile Include="Fixtures\UseCases\Startup\TestTinkApp.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\User\Account\TestValidator.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\User\TestUser.cs" />
|
||||
<Compile Include="Mocks\Bike\BikeCollectionMock.cs" />
|
||||
<Compile Include="Mocks\Connector\CopriCallsCacheMemory.cs" />
|
||||
<Compile Include="Mocks\Connector\ExceptionServer.cs" />
|
||||
<Compile Include="Mocks\DateTimeMocker.cs" />
|
||||
<Compile Include="Mocks\Device\DeviceMock.cs" />
|
||||
<Compile Include="Mocks\Device\SpecialFolderMock.cs" />
|
||||
<Compile Include="Mocks\Services\GeolocationMock.cs" />
|
||||
<Compile Include="Mocks\Services\LocksServiceMock.cs" />
|
||||
<Compile Include="Mocks\Services\PermissionsMock.cs" />
|
||||
<Compile Include="Mocks\User\Account\StoreMock.cs" />
|
||||
<Compile Include="TestHelper.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -204,6 +196,10 @@
|
|||
<Project>{3589ED1D-E734-429D-976F-1BEA4371DF14}</Project>
|
||||
<Name>LockItShared</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\TestFramework\TestFramework.csproj">
|
||||
<Project>{4884b154-2af0-4bca-aa53-1d82dfaf502b}</Project>
|
||||
<Name>TestFramework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\TINKLib\TINKLib.csproj">
|
||||
<Project>{b77f4222-0860-4494-a07c-ee8e09fa9983}</Project>
|
||||
<Name>TINKLib</Name>
|
||||
|
@ -211,6 +207,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Fixtures\ObjectTests\Connector\Updater\" />
|
||||
<Folder Include="Fixtures\UseCases\Startup\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
49
TestTINKLib/TestTINKLib.sln
Normal file
49
TestTINKLib/TestTINKLib.sln
Normal file
|
@ -0,0 +1,49 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31829.152
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestTINKLib", "TestTINKLib.csproj", "{730A31A5-6736-43CC-8F84-8FDA5093E283}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TINKLib", "..\TINKLib\TINKLib.csproj", "{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFramework", "..\TestFramework\TestFramework.csproj", "{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LockItBLE", "..\LockItBLE\LockItBLE.csproj", "{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LockItShared", "..\LockItShared\LockItShared.csproj", "{890B733E-1B82-4A5E-8374-C086FCD07AC3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{730A31A5-6736-43CC-8F84-8FDA5093E283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{730A31A5-6736-43CC-8F84-8FDA5093E283}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{730A31A5-6736-43CC-8F84-8FDA5093E283}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{730A31A5-6736-43CC-8F84-8FDA5093E283}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{890B733E-1B82-4A5E-8374-C086FCD07AC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{890B733E-1B82-4A5E-8374-C086FCD07AC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{890B733E-1B82-4A5E-8374-C086FCD07AC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{890B733E-1B82-4A5E-8374-C086FCD07AC3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F11B1C81-7325-4047-80E0-3D1A2B0A2C79}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,15 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XmlDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
<assemblyIdentity name="System.Xml.XmlDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue