mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-21 20:46:28 +02:00
Version 3.0.339
This commit is contained in:
parent
0468955d49
commit
52c9f6f1d9
43 changed files with 993 additions and 614 deletions
|
@ -1,39 +0,0 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Repository.Exception;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Repository.Exception
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestBookingDeclinedException
|
||||
{
|
||||
[Test]
|
||||
public void TestIsBookingDeclined()
|
||||
{
|
||||
const string responseText = "OK: BOOKING_REQUEST declined. Max count of 8 occupied bikes has been reached";
|
||||
|
||||
BookingDeclinedException exception = null;
|
||||
|
||||
Assert.That(() => BookingDeclinedException.IsBookingDeclined(responseText, out exception),
|
||||
Is.EqualTo(true));
|
||||
|
||||
Assert.That(() => exception.MaxBikesCount,
|
||||
Is.EqualTo(8));
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestIsBookingDeclined_InvalidNumber()
|
||||
{
|
||||
const string responseText = "OK: BOOKING_REQUEST declined. Max count of 8 occupied bikes has been reached";
|
||||
|
||||
BookingDeclinedException exception = null;
|
||||
|
||||
Assert.That(() => BookingDeclinedException.IsBookingDeclined(responseText, out exception),
|
||||
Is.EqualTo(true));
|
||||
|
||||
Assert.That(() => exception.MaxBikesCount,
|
||||
Is.EqualTo(8));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Repository.Exception;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Repository.Exception
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestNoGPSDataException
|
||||
{
|
||||
[Test]
|
||||
public void TestIsNotAtStation()
|
||||
{
|
||||
const string responseText = "Failure 2245: No GPS data, state change forbidden.";
|
||||
|
||||
NoGPSDataException exception = null;
|
||||
|
||||
Assert.That(() => NoGPSDataException.IsNoGPSData(responseText, out exception),
|
||||
Is.EqualTo(true));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestIsNotAtStation_InvalidNr()
|
||||
{
|
||||
const string responseText = "Failure 2248: No GPS data, state change forbidden.";
|
||||
|
||||
NoGPSDataException exception = null;
|
||||
|
||||
Assert.That(() => NoGPSDataException.IsNoGPSData(responseText, out exception),
|
||||
Is.EqualTo(false));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Repository.Exception;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Repository.Exception
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestNotAtStationException
|
||||
{
|
||||
[Test]
|
||||
public void TestIsNotAtStation()
|
||||
{
|
||||
const string responseText = "Failure 2178: bike 1545 out of GEO fencing. 15986 meter distance to next station 105. OK: bike 1545 locked confirmed";
|
||||
|
||||
NotAtStationException exception = null;
|
||||
|
||||
Assert.That(() => NotAtStationException.IsNotAtStation(responseText, out exception),
|
||||
Is.EqualTo(true));
|
||||
|
||||
Assert.That(() => exception.StationNr,
|
||||
Is.EqualTo(105));
|
||||
|
||||
Assert.That(() => exception.Distance,
|
||||
Is.EqualTo(15986));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestIsNotAtStation_InvalidNr()
|
||||
{
|
||||
const string responseText = "Failure 2177: bike 1545 out of GEO fencing. 15986 meter distance to next station 105. OK: bike 1545 locked confirmed";
|
||||
|
||||
NotAtStationException exception = null;
|
||||
|
||||
Assert.That(() => NotAtStationException.IsNotAtStation(responseText, out exception),
|
||||
Is.EqualTo(false));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue