sharee.bike-App/TestTINKLib/Fixtures/ObjectTests/Services/BluetoothLock/TestLockServiceSimulation.cs
Anja Müller-Meißner 0468955d49 Version 3.0.338
2022-09-08 09:55:14 +02:00

36 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using TINK.Model.Bikes;
using TINK.Model.Bikes.BikeInfoNS.BikeNS;
using TINK.Model.Bikes.BikeInfoNS.DriveNS;
using TINK.Services.BluetoothLock;
using TINK.Services.BluetoothLock.Tdo;
namespace TestTINKLib.Fixtures.ObjectTests.Service.LockService
{
[TestFixture]
public class TestLockServiceSimulation
{
[Test]
public void TestUpdateSimulationInstance_Update()
{
var service = new LocksServiceInReach();
var bikes = new BikeCollection(new Dictionary<string, TINK.Model.Bikes.BikeInfoNS.BC.BikeInfo>()
{
{ "42", new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo(new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("42", LockModel.ILockIt), new Drive(), 1, new Guid(),new byte[] { 1, 4 }, new byte[] { 3, 4 }, new byte[] { 3, 4 }, DateTime.Now, "a@b", "1" , null /*operator uri*/) },
{ "43", new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo(new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("43", LockModel.ILockIt), new Drive(), 3, new Guid(),new byte[] { 4, 4 }, new byte[] { 4, 7 }, new byte[] { 5, 4 }, DateTime.Now, "c@b", "1" , null /*operator uri*/) }
}
);
if (service is ILocksServiceFake serviceFake)
{
serviceFake.UpdateSimulation(bikes);
}
Assert.AreEqual(2, service.GetLocksStateAsync(new List<LockInfoAuthTdo>(), new TimeSpan(0, 0, 3)).Result.Count());
}
}
}