mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-12 05:26:28 +01:00
28 lines
1.2 KiB
C#
28 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using NUnit.Framework;
|
|
|
|
namespace TINK.Services.BluetoothLock
|
|
{
|
|
[TestFixture]
|
|
public class TestTimeOutProvider
|
|
{
|
|
[Test]
|
|
public void TestCtor()
|
|
{
|
|
Assert.That(new TimeOutProvider().MultiConnect.TotalSeconds, Is.EqualTo(5), "Unexpected bluetooth default timeout detected.");
|
|
|
|
Assert.That(new TimeOutProvider(new List<TimeSpan>() { new TimeSpan(0, 0, 4) }).MultiConnect.TotalSeconds, Is.EqualTo(4));
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetSingleConnect()
|
|
{
|
|
Assert.That(new TimeOutProvider(new List<TimeSpan>() { new TimeSpan(0, 0, 4) }).GetSingleConnect(1).TotalSeconds, Is.EqualTo(4));
|
|
Assert.That(new TimeOutProvider(new List<TimeSpan>() { new TimeSpan(0, 0, 4) }).GetSingleConnect(2).TotalSeconds, Is.EqualTo(8));
|
|
Assert.That(new TimeOutProvider(new List<TimeSpan>() { new TimeSpan(0, 0, 4) }).GetSingleConnect(3).TotalSeconds, Is.EqualTo(12));
|
|
Assert.That(new TimeOutProvider(new List<TimeSpan>() { new TimeSpan(0, 0, 4) }).GetSingleConnect(4).TotalSeconds, Is.EqualTo(16));
|
|
Assert.That(new TimeOutProvider(new List<TimeSpan>() { new TimeSpan(0, 0, 4) }).GetSingleConnect(5).TotalSeconds, Is.EqualTo(16));
|
|
}
|
|
}
|
|
}
|