mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-19 11:37:28 +02:00
Version 3.0.360
This commit is contained in:
parent
5c0b2e70c9
commit
faf68061f4
160 changed files with 2114 additions and 1932 deletions
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
@ -66,12 +66,12 @@ namespace UITest.Fixtures.Connector
|
|||
sessionCookie,
|
||||
merchantId);
|
||||
|
||||
string l_oLogoutResponse;
|
||||
string logoutResponse;
|
||||
|
||||
l_oLogoutResponse = Post(l_oCommand, copriHost);
|
||||
logoutResponse = Post(l_oCommand, copriHost);
|
||||
|
||||
/// Extract session cookie from response.
|
||||
return JsonConvert.DeserializeObject<ResponseContainer<AuthorizationoutResponse>>(l_oLogoutResponse)?.shareejson;
|
||||
return JsonConvert.DeserializeObject<ResponseContainer<AuthorizationoutResponse>>(logoutResponse)?.shareejson;
|
||||
#else
|
||||
return null;
|
||||
#endif
|
||||
|
@ -80,24 +80,24 @@ namespace UITest.Fixtures.Connector
|
|||
/// <summary>
|
||||
/// Get list of stations from file.
|
||||
/// </summary>
|
||||
/// <param name="p_strCopriHost">URL of the copri host to connect to.</param>
|
||||
/// <param name="p_strMerchantId">Id of the merchant.</param>
|
||||
/// <param name="p_strCookie">Auto cookie of user if user is logged in.</param>
|
||||
/// <param name="copriHost">URL of the copri host to connect to.</param>
|
||||
/// <param name="merchantId">Id of the merchant.</param>
|
||||
/// <param name="cookie">Auto cookie of user if user is logged in.</param>
|
||||
/// <returns>List of files.</returns>
|
||||
public static StationsAvailableResponse GetStationsAllCall(
|
||||
string p_strCopriHost,
|
||||
string p_strMerchantId,
|
||||
string p_strCookie = null)
|
||||
string copriHost,
|
||||
string merchantId,
|
||||
string cookie = null)
|
||||
{
|
||||
var l_oCommand = string.Format(
|
||||
"request=stations_all&authcookie={0}{1}",
|
||||
p_strCookie,
|
||||
p_strMerchantId);
|
||||
cookie,
|
||||
merchantId);
|
||||
|
||||
#if !WINDOWS_UWP
|
||||
string l_oStationsAllResponse;
|
||||
|
||||
l_oStationsAllResponse = Post(l_oCommand, p_strCopriHost);
|
||||
l_oStationsAllResponse = Post(l_oCommand, copriHost);
|
||||
|
||||
// Extract bikes from response.
|
||||
return JsonConvert.DeserializeObject<ResponseContainer<StationsAvailableResponse>>(l_oStationsAllResponse)?.shareejson;
|
||||
|
@ -110,7 +110,7 @@ namespace UITest.Fixtures.Connector
|
|||
/// Gets a list of bikes from Copri.
|
||||
/// </summary>
|
||||
/// <param name="copriHost">URL of the copri host to connect to.</param>
|
||||
/// <param name="p_strMerchantId">Id of the merchant.</param>
|
||||
/// <param name="merchantId">Id of the merchant.</param>
|
||||
/// <param name="p_strSessionCookie">Cookie to authenticate user.</param>
|
||||
/// <returns>Response holding list of bikes.</returns>
|
||||
public static BikesAvailableResponse GetBikesAvailableCall(
|
||||
|
@ -136,7 +136,7 @@ namespace UITest.Fixtures.Connector
|
|||
/// <summary>
|
||||
/// Gets a list of bikes reserved/ booked by acctive user from Copri.
|
||||
/// </summary>
|
||||
/// <param name="p_strMerchantId">Id of the merchant.</param>
|
||||
/// <param name="merchantId">Id of the merchant.</param>
|
||||
/// <param name="p_strSessionCookie">Cookie to authenticate user.</param>
|
||||
/// <returns>Response holding list of bikes.</returns>
|
||||
public static BikesReservedOccupiedResponse GetBikesOccupiedCall(
|
||||
|
@ -163,13 +163,13 @@ namespace UITest.Fixtures.Connector
|
|||
/// <summary>
|
||||
/// Gets booking request response.
|
||||
/// </summary>
|
||||
/// <param name="p_strMerchantId">Id of the merchant.</param>
|
||||
/// <param name="merchantId">Id of the merchant.</param>
|
||||
/// <param name="p_iBikeId">Id of the bike to book.</param>
|
||||
/// <param name="p_strSessionCookie">Cookie identifying the user.</param>
|
||||
/// <returns>Response on booking request.</returns>
|
||||
public static ReservationBookingResponse DoReserveCall(
|
||||
string copriHost,
|
||||
string p_strMerchantId,
|
||||
string merchantId,
|
||||
string p_iBikeId,
|
||||
string p_strSessionCookie)
|
||||
{
|
||||
|
@ -178,7 +178,7 @@ namespace UITest.Fixtures.Connector
|
|||
"request=booking_request&bike={0}&authcookie={1}{2}",
|
||||
p_iBikeId,
|
||||
p_strSessionCookie,
|
||||
p_strMerchantId);
|
||||
merchantId);
|
||||
|
||||
string l_oBikesAvaialbeResponse = Post(l_oCommand, copriHost);
|
||||
|
||||
|
@ -192,13 +192,13 @@ namespace UITest.Fixtures.Connector
|
|||
/// <summary>
|
||||
/// Gets canel booking request response.
|
||||
/// </summary>
|
||||
/// <param name="p_strMerchantId">Id of the merchant.</param>
|
||||
/// <param name="merchantId">Id of the merchant.</param>
|
||||
/// <param name="p_iBikeId">Id of the bike to book.</param>
|
||||
/// <param name="p_strSessionCookie">Cookie of the logged in user.</param>
|
||||
/// <returns>Response on cancel booking request.</returns>
|
||||
public static ReservationCancelReturnResponse DoCancelReservationCall(
|
||||
string copriHost,
|
||||
string p_strMerchantId,
|
||||
string merchantId,
|
||||
string p_iBikeId,
|
||||
string p_strSessionCookie)
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ namespace UITest.Fixtures.Connector
|
|||
"request=booking_cancel&bike={0}&authcookie={1}{2}",
|
||||
p_iBikeId,
|
||||
p_strSessionCookie,
|
||||
p_strMerchantId);
|
||||
merchantId);
|
||||
string l_oBikesAvaialbeResponse;
|
||||
|
||||
l_oBikesAvaialbeResponse = Post(l_oCommand, copriHost);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using TINK.Model.Connector;
|
||||
|
@ -23,7 +23,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
null /*UI language */,
|
||||
"", // Not logged in
|
||||
"",
|
||||
l_oCopri).Command;
|
||||
server: l_oCopri).Command;
|
||||
|
||||
Assert.AreEqual(typeof(Command), l_oCommand.GetType());
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
null /*UI language */,
|
||||
"123", // Logged in
|
||||
"a@b",
|
||||
l_oCopri).Command;
|
||||
server: l_oCopri).Command;
|
||||
|
||||
Assert.AreEqual(typeof(CommandLoggedIn), l_oCommand.GetType());
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
null /*UI language */,
|
||||
"",
|
||||
"",
|
||||
l_oCopri).Query;
|
||||
server: l_oCopri).Query;
|
||||
|
||||
Assert.AreEqual(typeof(TINK.Model.Connector.Query), l_oQuery.GetType());
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
null /*UI language */,
|
||||
"123",
|
||||
"a@b",
|
||||
l_oCopri).Query;
|
||||
server: l_oCopri).Query;
|
||||
|
||||
Assert.AreEqual(typeof(QueryLoggedIn), l_oQuery.GetType());
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NSubstitute;
|
||||
|
@ -22,7 +22,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
null /*UI language */,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory001());
|
||||
server: new CopriCallsMemory001());
|
||||
|
||||
var filter = new FilteredConnector(new List<string> { FilterHelper.CARGOBIKE, FilterHelper.CITYBIKE }, connector);
|
||||
var stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
@ -58,7 +58,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
null /*UI language */,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory001());
|
||||
server: new CopriCallsMemory001());
|
||||
|
||||
var l_oFilter = new FilteredConnector(new List<string> { FilterHelper.CARGOBIKE, FilterHelper.CITYBIKE }, l_oConnector);
|
||||
var l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue