sharee.bike-App/TestShareeLib/Repository/Exception/TestBookingDeclinedException.cs
2022-09-16 11:19:46 +02:00

39 lines
1,005 B
C#

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