mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-23 07:36:31 +01:00
27 lines
1.2 KiB
C#
27 lines
1.2 KiB
C#
using System;
|
|
using NUnit.Framework;
|
|
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 min. 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 min. 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."));
|
|
}
|
|
}
|
|
}
|