sharee.bike-App/TestFramework/Services/CopriApi/CopriCallsCacheMemory001.cs

107 lines
3.5 KiB
C#
Raw Normal View History

2021-07-12 21:31:46 +02:00
using System;
using System.Threading.Tasks;
2021-11-14 23:27:29 +01:00
using TINK.Model.Services.CopriApi;
2021-07-12 21:31:46 +02:00
using TINK.Repository.Response;
2021-11-14 23:27:29 +01:00
using TINK.Repository.Request;
using TINK.Model.Device;
using System.Collections.Generic;
using TestFramework.Repository;
2021-07-12 21:31:46 +02:00
2021-11-14 23:27:29 +01:00
namespace TestFramework.Services.CopriApi.Connector
2021-07-12 21:31:46 +02:00
{
2021-11-14 23:27:29 +01:00
/// <summary> Allows use of memory for retrieving defined respones.</summary>
public class CopriCallsCacheMemory001 : ICopriCache
2021-07-12 21:31:46 +02:00
{
2021-11-14 23:27:29 +01:00
private CopriCallsMemory001 server;
2021-07-12 21:31:46 +02:00
2021-11-14 23:27:29 +01:00
public CopriCallsCacheMemory001(string sessionCookie = null)
2021-07-12 21:31:46 +02:00
{
2021-11-14 23:27:29 +01:00
server = new CopriCallsMemory001(sessionCookie);
2021-07-12 21:31:46 +02:00
}
2021-11-14 23:27:29 +01:00
public bool IsStationsExpired => true;
public bool IsBikesAvailableExpired => true;
public bool IsBikesOccupiedExpired => true;
2021-07-12 21:31:46 +02:00
2021-11-14 23:27:29 +01:00
public bool IsConnected => server.IsConnected;
2021-07-12 21:31:46 +02:00
2021-11-14 23:27:29 +01:00
public string SessionCookie => server.SessionCookie;
public string MerchantId => server.MerchantId;
public void AddToCache(StationsAvailableResponse stations)
{
return;
}
public void AddToCache(BikesAvailableResponse bikes)
{
return;
}
public void AddToCache(BikesReservedOccupiedResponse bikes)
{
return;
}
2021-07-12 21:31:46 +02:00
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)
2021-11-14 23:27:29 +01:00
=> throw new NotSupportedException();
2021-07-12 21:31:46 +02:00
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();
}
2021-12-08 17:57:30 +01:00
public Task<DoReturnResponse> DoReturn(string bikeId, LocationDto location, ISmartDevice smartDevice, Uri operatorUri)
=> throw new NotImplementedException();
2021-07-12 21:31:46 +02:00
public Task<SubmitFeedbackResponse> DoSubmitFeedback(string bikeId, string message, bool isBikeBroken, Uri operatorUri)
=> throw new NotImplementedException();
2021-08-01 17:24:15 +02:00
/// <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();
2021-07-12 21:31:46 +02:00
public Task<BikesAvailableResponse> GetBikesAvailableAsync()
{
2021-11-14 23:27:29 +01:00
return server.GetBikesAvailableAsync();
2021-07-12 21:31:46 +02:00
}
public Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
{
2021-11-14 23:27:29 +01:00
return server.GetBikesOccupiedAsync();
2021-07-12 21:31:46 +02:00
}
public Task<StationsAvailableResponse> GetStationsAsync()
2021-07-12 21:31:46 +02:00
{
2021-11-14 23:27:29 +01:00
return server.GetStationsAsync();
2021-07-12 21:31:46 +02:00
}
}
}