2022-08-30 15:42:25 +02:00
|
|
|
|
using System.Collections.Generic;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using TINK.Model;
|
2022-08-30 15:42:25 +02:00
|
|
|
|
using TINK.Model.Bikes;
|
2022-01-04 18:59:16 +01:00
|
|
|
|
using TINK.Model.Station;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
using TINK.Model.User;
|
|
|
|
|
|
|
|
|
|
namespace TestTINKLib.Fixtures.UseCases
|
|
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
|
public class TestHelper
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get all bikes at a given station from copri.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static async Task<BikeCollectionMutable> GetBikesAtStation(
|
|
|
|
|
User user,
|
|
|
|
|
TINK.Model.Connector.IConnector connector,
|
|
|
|
|
IEnumerable<IStation> stations,
|
|
|
|
|
string selectedStationId)
|
|
|
|
|
{
|
|
|
|
|
var l_oBikesAtStation = new BikeCollectionMutable();
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
var l_oBikesAvailable = (await connector.Query.GetBikesAsync()).Response;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
l_oBikesAtStation.Update(l_oBikesAvailable.GetAtStation(selectedStationId), stations);
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
return l_oBikesAtStation;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
}
|