mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 10:36:30 +01:00
e321764119
Minor fiexes.
70 lines
1.9 KiB
C#
70 lines
1.9 KiB
C#
using NUnit.Framework;
|
|
using System;
|
|
using TINK.Repository.Exception;
|
|
using TINK.Repository.Request;
|
|
|
|
namespace TestShareeLib.Repository.Request
|
|
{
|
|
[TestFixture]
|
|
public class TestRequestBuilder
|
|
{
|
|
[Test]
|
|
public void TestDoAuthorize()
|
|
{
|
|
Assert.AreEqual(
|
|
"request=authorization&merchant_id=123&user_id=abc%40cde&user_pw=%2B%3F&hw_id=789",
|
|
new RequestBuilder("123").DoAuthorization("abc@cde", "+?", "789"));
|
|
}
|
|
|
|
[Test]
|
|
public void TestDoAuthout()
|
|
{
|
|
Assert.Throws<CallNotRequiredException>(() =>
|
|
new RequestBuilder("123").DoAuthout());
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetBikesAvailable()
|
|
{
|
|
Assert.AreEqual(
|
|
"request=bikes_available&system=all&authcookie=123",
|
|
new RequestBuilder("123").GetBikesAvailable());
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetBikesOccupied()
|
|
{
|
|
Assert.Throws< NotSupportedException>(() =>
|
|
new RequestBuilder("123").GetBikesOccupied());
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetStations()
|
|
{
|
|
Assert.AreEqual(
|
|
"request=stations_available&authcookie=123",
|
|
new RequestBuilder("123").GetStations());
|
|
}
|
|
|
|
[Test]
|
|
public void TestDoReserve()
|
|
{
|
|
Assert.Throws<NotSupportedException>(() =>
|
|
new RequestBuilder("123").DoReserve("42"));
|
|
}
|
|
|
|
[Test]
|
|
public void TestDoCancelReservation()
|
|
{
|
|
Assert.Throws<NotSupportedException>(() =>
|
|
new RequestBuilder("123").DoCancelReservation("42"));
|
|
}
|
|
|
|
[Test]
|
|
public void TestDoSubmitFeedback()
|
|
{
|
|
Assert.Throws<NotSupportedException>(() =>
|
|
new RequestBuilder("123").DoSubmitFeedback("bike3", "Hi", false));
|
|
}
|
|
}
|
|
}
|