mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 10:36:30 +01:00
28 lines
1.3 KiB
C#
28 lines
1.3 KiB
C#
|
using NUnit.Framework;
|
|||
|
using System;
|
|||
|
using TINK.ViewModel;
|
|||
|
|
|||
|
namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
{
|
|||
|
[TestFixture]
|
|||
|
public class TestBikeAtStationInUseStateInfoProvider
|
|||
|
{
|
|||
|
[Test]
|
|||
|
public void TestGetReservedInfo()
|
|||
|
{
|
|||
|
Assert.That(new BikeAtStationInUseStateInfoProvider().GetReservedInfo(null), Is.EqualTo("Max. reservation time of 15 minutes expired."));
|
|||
|
Assert.That(new BikeAtStationInUseStateInfoProvider().GetReservedInfo(null, code: "Code123"), Is.Not.Null);
|
|||
|
Assert.That(new BikeAtStationInUseStateInfoProvider().GetReservedInfo(TimeSpan.FromSeconds(3), code: "Code123"), Is.Not.Null);
|
|||
|
Assert.That(new BikeAtStationInUseStateInfoProvider().GetReservedInfo(TimeSpan.FromSeconds(60)), Is.EqualTo("Still 1 minutes reserved."));
|
|||
|
}
|
|||
|
|
|||
|
[Test]
|
|||
|
public void Test()
|
|||
|
{
|
|||
|
Assert.That(new BikeAtStationInUseStateInfoProvider().GetBookedInfo(null), Is.EqualTo("Bike is rented."));
|
|||
|
Assert.That(new BikeAtStationInUseStateInfoProvider().GetBookedInfo(DateTime.Parse("2020-12-19 0:22"), code: "Code123"), Is.Not.Null);
|
|||
|
Assert.That(new BikeAtStationInUseStateInfoProvider().GetBookedInfo(DateTime.Parse("2020-12-19 0:22"), code: "Code123"), Is.EqualTo("Code Code123, rented since 19. December 00:22."));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|