mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-09-24 16:06:29 +02:00
78 lines
2.3 KiB
C#
78 lines
2.3 KiB
C#
using NUnit.Framework;
|
|
using System.Collections.Generic;
|
|
using TINK.Model;
|
|
using TINK.Model.Bike;
|
|
|
|
namespace TestTINKLib.Fixtures.ObjectTests.Bike
|
|
{
|
|
/// <summary>
|
|
/// Moved to TestShareeLib (.Net Core)
|
|
/// </summary>
|
|
[TestFixture]
|
|
public class TestBikeCollectionFilter
|
|
{
|
|
[Test]
|
|
public void TestGetAtStation()
|
|
{
|
|
var coll = new BikeCollection(
|
|
new Dictionary<int, TINK.Model.Bike.BC.BikeInfo>
|
|
{
|
|
{3, new TINK.Model.Bike.BC.BikeInfo(7, 3 /* Stadion id */) },
|
|
{7, new TINK.Model.Bike.BC.BikeInfo(8, 12 /* Stadion id */) },
|
|
{12, new TINK.Model.Bike.BC.BikeInfo(33, 12 /* Stadion id */) }
|
|
});
|
|
|
|
Assert.AreEqual(
|
|
0,
|
|
BikeCollectionFilter.GetAtStation(null, 12).Count);
|
|
|
|
Assert.AreEqual(
|
|
0,
|
|
coll.GetAtStation(null).Count);
|
|
|
|
Assert.AreEqual(
|
|
0,
|
|
coll.GetAtStation(22).Count);
|
|
|
|
Assert.AreEqual(
|
|
1,
|
|
coll.GetAtStation(3).Count);
|
|
|
|
Assert.AreEqual(
|
|
2,
|
|
coll.GetAtStation(12).Count);
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetLockIt()
|
|
{
|
|
var coll = new BikeCollection(
|
|
new Dictionary<int, TINK.Model.Bike.BC.BikeInfo>
|
|
{
|
|
{7, new TINK.Model.Bike.BC.BikeInfo(8, 12 /* Stadion id */) },
|
|
{12, new TINK.Model.Bike.BC.BikeInfo(33, 12 /* Stadion id */) }
|
|
});
|
|
|
|
|
|
Assert.AreEqual(
|
|
0,
|
|
coll.GetLockIt().Count);
|
|
|
|
coll = new BikeCollection(
|
|
new Dictionary<int, TINK.Model.Bike.BC.BikeInfo>
|
|
{
|
|
{7, new TINK.Model.Bike.BC.BikeInfo(8, 12 /* Stadion id */) },
|
|
{11, new TINK.Model.Bike.BluetoothLock.BikeInfo(33, 12 /* Stadion id */) },
|
|
{12, new TINK.Model.Bike.BC.BikeInfo(33, 12 /* Stadion id */) }
|
|
});
|
|
|
|
Assert.AreEqual(
|
|
0,
|
|
BikeCollectionFilter.GetLockIt(null).Count);
|
|
|
|
Assert.AreEqual(
|
|
1,
|
|
coll.GetLockIt().Count);
|
|
}
|
|
}
|
|
}
|