sharee.bike-App/TestTINKLib/Fixtures/ObjectTests/Repository/Exception/TestNotAtStationException.cs
Anja Müller-Meißner 573fe77e12 Version 3.0.337
2022-08-30 15:42:25 +02:00

37 lines
1.2 KiB
C#

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));
}
}
}