using System.Linq; using System.Collections.Generic; using NUnit.Framework; using TINK.Model.Bike; using TINK.Services.BluetoothLock; using TINK.Services.BluetoothLock.Tdo; using System; 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() { { "42", new TINK.Model.Bike.BluetoothLock.BikeInfo("42", 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.Bike.BluetoothLock.BikeInfo("43", 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(), new TimeSpan(0, 0, 3)).Result.Count()); } } }