2022-09-20 13:51:55 +02:00
|
|
|
using System;
|
2022-08-30 15:42:25 +02:00
|
|
|
using System.Collections.Generic;
|
2021-07-12 21:31:46 +02:00
|
|
|
using System.Threading.Tasks;
|
2022-09-20 13:51:55 +02:00
|
|
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
2022-12-27 21:08:09 +01:00
|
|
|
using TINK.Model.Connector;
|
2021-11-14 23:27:29 +01:00
|
|
|
using TINK.Model.Services.CopriApi;
|
|
|
|
using TINK.Repository.Request;
|
2022-08-30 15:42:25 +02:00
|
|
|
using TINK.Repository.Response;
|
2023-04-19 12:14:14 +02:00
|
|
|
using TINK.Repository.Response.Stations;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
2023-05-09 08:47:52 +02:00
|
|
|
namespace TestFramework.Repository
|
2021-07-12 21:31:46 +02:00
|
|
|
{
|
2023-04-19 12:14:14 +02:00
|
|
|
/// <summary> Allows use of memory for retrieving defined responses.</summary>
|
2022-09-06 16:08:19 +02:00
|
|
|
public class CopriCallsCacheMemory001 : ICopriCache
|
|
|
|
{
|
|
|
|
private CopriCallsMemory001 server;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
public CopriCallsCacheMemory001(string sessionCookie = null)
|
|
|
|
{
|
|
|
|
server = new CopriCallsMemory001(sessionCookie);
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
public bool IsStationsExpired => true;
|
|
|
|
|
|
|
|
public bool IsBikesAvailableExpired => true;
|
|
|
|
|
|
|
|
public bool IsBikesOccupiedExpired => true;
|
|
|
|
|
|
|
|
public bool IsConnected => server.IsConnected;
|
|
|
|
|
|
|
|
public string SessionCookie => server.SessionCookie;
|
|
|
|
|
|
|
|
public string MerchantId => server.MerchantId;
|
|
|
|
|
|
|
|
public void AddToCache(StationsAvailableResponse stations)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-11-06 12:23:09 +01:00
|
|
|
/// <summary> Adds a bikes response to cache.</summary>
|
|
|
|
/// <param name="bikes">Bikes to add.</param>
|
2023-11-21 15:26:57 +01:00
|
|
|
/// <param name="operatorUri">Uri of the operator host to get bikes from or null if bikes have to be gotten form primary host.</param>
|
|
|
|
/// <param name="stationId"> Id of station which was used for filtering bikes. Null if no filtering was applied.</param>
|
|
|
|
/// <param name="bikeId"> Id of bike which was used for filtering bikes. Null if no filtering was applied.</param>
|
|
|
|
public void AddToCache(BikesAvailableResponse bikes, Uri operatorUri = null, string stationId = null, string bikeId = null)
|
2022-09-06 16:08:19 +02:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void AddToCache(BikesReservedOccupiedResponse bikes)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 NotSupportedException();
|
|
|
|
|
|
|
|
public Task<ResponseBase> StartReturningBike(
|
|
|
|
string bikeId,
|
|
|
|
Uri operatorUri)
|
|
|
|
=> null;
|
|
|
|
|
|
|
|
public Task<ReservationBookingResponse> UpdateLockingStateAsync(
|
|
|
|
string bikeId,
|
|
|
|
lock_state state,
|
|
|
|
Uri operatorUri,
|
|
|
|
LocationDto geolocation,
|
2022-09-20 13:51:55 +02:00
|
|
|
double batteryPercentage,
|
|
|
|
IVersionInfo versionInfo)
|
2022-09-06 16:08:19 +02:00
|
|
|
=> throw new NotImplementedException();
|
|
|
|
|
2022-12-27 21:08:09 +01:00
|
|
|
public Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
2022-09-06 16:08:19 +02:00
|
|
|
=> throw new NotImplementedException();
|
|
|
|
|
|
|
|
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
|
|
|
=> throw new NotImplementedException();
|
|
|
|
|
|
|
|
public Task<ReservationBookingResponse> BookReservedAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
|
|
|
=> throw new NotImplementedException();
|
|
|
|
|
2023-02-22 14:03:35 +01:00
|
|
|
public Task<DoReturnResponse> DoReturn(string bikeId, LocationDto location, Uri operatorUri)
|
2022-09-06 16:08:19 +02:00
|
|
|
=> throw new NotImplementedException();
|
|
|
|
|
|
|
|
public Task<DoReturnResponse> ReturnAndStartClosingAsync(
|
|
|
|
string bikeId,
|
|
|
|
Uri operatorUri)
|
|
|
|
=> throw new NotImplementedException();
|
|
|
|
|
|
|
|
public Task<SubmitFeedbackResponse> DoSubmitFeedback(string bikeId, int? currentChargeBars, 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();
|
|
|
|
|
2023-11-06 12:23:09 +01:00
|
|
|
/// <summary> Gets a list of bikes from Copri. </summary>
|
|
|
|
/// <param name="operatorUri">Uri of the operator host to get bikes from or null if bikes have to be gotten form primary host.</param>
|
2023-11-21 15:26:57 +01:00
|
|
|
/// <param name="stationId"> Id of station which is used for filtering bikes. Null if no filtering should be applied.</param>
|
|
|
|
/// <param name="bikeId"> Id of bike which is used for filtering bikes. Null if no filtering should be applied.</param>
|
2023-11-06 12:23:09 +01:00
|
|
|
/// <returns>Response holding list of bikes.</returns>
|
2023-11-21 15:26:57 +01:00
|
|
|
public Task<BikesAvailableResponse> GetBikesAvailableAsync(Uri operatorUri = null, string stationId = null, string bikeId = null)
|
|
|
|
=> server.GetBikesAvailableAsync(operatorUri, stationId, bikeId);
|
2021-07-12 21:31:46 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
public Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
|
|
|
|
{
|
|
|
|
return server.GetBikesOccupiedAsync();
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
public Task<StationsAvailableResponse> GetStationsAsync()
|
|
|
|
{
|
|
|
|
return server.GetStationsAsync();
|
|
|
|
}
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
}
|