mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-23 15:46:29 +01:00
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
|
using System.Threading.Tasks;
|
|||
|
using TINK.Model.Bike;
|
|||
|
using TINK.Model.User;
|
|||
|
|
|||
|
namespace TestFramework
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Provides helper functionality. Used in TestShareeLib and TestTINKLib.
|
|||
|
/// </summary>
|
|||
|
public static class TestHelper
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Eases comparison of xml- files.
|
|||
|
/// </summary>
|
|||
|
/// <param name="p_strXmlFile"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string PrepareXmlForStringCompare(string p_strXmlFile)
|
|||
|
{
|
|||
|
return p_strXmlFile.Replace("\r\n", string.Empty).Replace("\t", string.Empty).Replace(" ", string.Empty);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Get all bikes at a given station from copri.
|
|||
|
/// </summary>
|
|||
|
public static async Task<BikeCollectionMutable> GetBikesAtStation(
|
|||
|
User user,
|
|||
|
TINK.Model.Connector.IConnector connector,
|
|||
|
string selectedStation)
|
|||
|
{
|
|||
|
var l_oBikesAtStation = new BikeCollectionMutable();
|
|||
|
|
|||
|
var l_oBikesAvailable = (await connector.Query.GetBikesAsync()).Response;
|
|||
|
|
|||
|
l_oBikesAtStation.Update(TINK.Model.BikeCollectionFilter.GetAtStation(l_oBikesAvailable, selectedStation));
|
|||
|
|
|||
|
return l_oBikesAtStation;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|