mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-19 03:27:29 +02:00
Version 3.0.261
This commit is contained in:
parent
8aa3089f32
commit
4bccfe740b
80 changed files with 2672 additions and 458 deletions
86
TestFramework/Services/BluetoothLock/LocksServiceMock.cs
Normal file
86
TestFramework/Services/BluetoothLock/LocksServiceMock.cs
Normal file
|
@ -0,0 +1,86 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Model.Bike;
|
||||
using TINK.Model.Bike.BluetoothLock;
|
||||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Services.BluetoothLock.Tdo;
|
||||
|
||||
namespace TestFramework.Services.BluetoothLock
|
||||
{
|
||||
public class LocksServiceMock : ILocksService
|
||||
{
|
||||
/// <param name="connectTimeout">Timeout for connect operation of a single lock.</param>
|
||||
public async Task<IEnumerable<LockInfoTdo>> GetLocksStateAsync(IEnumerable<LockInfoAuthTdo> locksInfo, TimeSpan connectTimeout)
|
||||
{
|
||||
return await Task.FromResult(new List<LockInfoTdo>());
|
||||
}
|
||||
|
||||
/// <summary> Holds timeout values for series of connecting attemps to a lock or multiple locks. </summary>
|
||||
public ITimeOutProvider TimeOut { get; set; }
|
||||
|
||||
public void UpdateSimulation(BikeCollection bikes) {}
|
||||
|
||||
/// <summary> Opens lock.</summary>
|
||||
/// <param name="bike">Bike object to update.</param>
|
||||
public async Task<LockitLockingState?> OpenAsync(int lockId, byte[] copriKey) => await Task.FromResult(LockitLockingState.Open);
|
||||
|
||||
/// <summary> Closes lock.</summary>
|
||||
/// <param name="bike">Bike object to update.</param>
|
||||
public async Task<LockitLockingState?> CloseAsync(int lockId, byte[] copriKey) => await Task.FromResult(LockitLockingState.Closed);
|
||||
|
||||
/// <summary> Gets the state of a bike. </summary>
|
||||
/// <param name="lockId">Id of lockId to get state for.</param>
|
||||
/// <returns></returns>
|
||||
public async Task<LockitLockingState?> GetState(string lockId) => await Task.FromResult((LockitLockingState?)null);
|
||||
|
||||
/// <summary> Connects to lock.</summary>
|
||||
/// <param name="authInfo"> Info required to connect to lock.</param>
|
||||
/// <param name="connectTimeout">Timeout for connect operation.</param>
|
||||
public async Task<LockInfoTdo> ConnectAsync(LockInfoAuthTdo authInfo, TimeSpan connectTimeout)
|
||||
{
|
||||
return await Task.FromResult(new LockInfoTdo.Builder { Id = 12, Guid = new System.Guid("00000000-0000-0000-0000-000000000042"), State = null }.Build());
|
||||
}
|
||||
|
||||
/// <summary> Set sound settings.</summary>
|
||||
/// <param name="lockId">Id of lock to set sound settings.</param>
|
||||
public async Task<bool> SetSoundAsync(int lockId, SoundSettings settings)
|
||||
{
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary> Gets battery percentage.</summary>
|
||||
/// <param name="lockId">Id of lock to get info for.</param>
|
||||
public Task<double> GetBatteryPercentageAsync(int lockId)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary> Sets whether alarm is on or off.</summary>
|
||||
/// <param name="lockId">Id of lock to get info from.</param>
|
||||
public async Task SetIsAlarmOffAsync(int lockId, bool activated)
|
||||
{
|
||||
await Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary> Gets whether alarm is on or off.</summary>
|
||||
/// <param name="lockId">Id of lock to get info for.</param>
|
||||
public async Task<bool> GetIsAlarmOffAsync(int lockId)
|
||||
{
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
/// <summary>Gets a lock by bike Id.</summary>
|
||||
/// <param name="bikeId"></param>
|
||||
/// <returns>Lock object</returns>
|
||||
public ILockService this[int bikeId]
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Task<LockingState> DisconnectAsync(int bikeId, Guid bikeGuid) => throw new NotSupportedException();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue