sharee.bike-App/SharedBusinessLogic.Tests.Framework/Repository/CopriCallsCacheMemory001v2NotLoggedIn.cs
2024-04-09 12:53:23 +02:00

146 lines
5.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
using ShareeBike.Model.Connector;
using ShareeBike.Repository.Request;
using ShareeBike.Repository.Response.Stations;
using ShareeBike.Repository.Response;
using ShareeBike.Model.Services.CopriApi;
namespace SharedBusinessLogic.Tests.Framework.Repository
{
public class CopriCallsCacheMemory001v2NotLoggedIn : ICopriCache
{
private CopriCallsMemory001v2NotLoggedIn server;
public CopriCallsCacheMemory001v2NotLoggedIn(string sessionCookie = null)
{
server = new CopriCallsMemory001v2NotLoggedIn(sessionCookie);
}
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;
}
/// <summary> Adds a bikes response to cache.</summary>
/// <param name="bikes">Bikes to add.</param>
/// <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)
{
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<BookingActionResponse> 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,
double batteryPercentage,
IVersionInfo versionInfo)
=> throw new NotImplementedException();
public Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
=> 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();
public Task<DoReturnResponse> DoReturn(string bikeId, LocationDto location, Uri operatorUri)
=> 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();
/// <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>
/// <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>
/// <returns>Response holding list of bikes.</returns>
public Task<BikesAvailableResponse> GetBikesAvailableAsync(Uri operatorUri = null, string stationId = null, string bikeId = null)
=> server.GetBikesAvailableAsync(operatorUri, stationId, bikeId);
public Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
{
return server.GetBikesOccupiedAsync();
}
public Task<StationsAvailableResponse> GetStationsAsync()
{
return server.GetStationsAsync();
}
/// <summary>
/// Updates cache from bike which changed rental state.
/// </summary>
/// <param name="response">Response to update from.</param>
public void Update(BikeInfoReservedOrBooked response)
=> throw new NotImplementedException();
/// <summary> Updates cache from bike which changed rental state (reservation/ booking canceled). </summary>
public void Update(BookingActionResponse response)
=> throw new NotImplementedException();
}
}