mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 22:07:28 +02:00
Legacy testing lib added..
This commit is contained in:
parent
0167fc321f
commit
47ed05837e
118 changed files with 17505 additions and 0 deletions
|
@ -0,0 +1,49 @@
|
|||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
using TINK.Repository.Exception;
|
||||
using TINK.Repository.Response;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Connector.Exception
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestAuthcookieNotDefinedException
|
||||
{
|
||||
[Test]
|
||||
public void TestConstruct()
|
||||
{
|
||||
Assert.AreEqual(
|
||||
"Can not test.\r\nDie Sitzung ist abgelaufen. Bitte neu anmelden.",
|
||||
(new AuthcookieNotDefinedException(
|
||||
"Can not test.",
|
||||
JsonConvert.DeserializeObject<ResponseBase>(@"{ ""response_state"" : ""Some inner error description""}"))).Message);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestTestIsAuthcookieNotDefined_False()
|
||||
{
|
||||
var response = JsonConvert.DeserializeObject<BikesReservedOccupiedResponse>(@"{ ""response_state"" : ""OK"" }");
|
||||
Assert.That(AuthcookieNotDefinedException.IsAuthcookieNotDefined(response, "Test context", out AuthcookieNotDefinedException exception),
|
||||
Is.EqualTo(false));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestIsAuthcookieNotDefined_TrueLegacy()
|
||||
{
|
||||
var response = JsonConvert.DeserializeObject<ResponseBase>($"{{ \"response_state\" : \"Failure 1003: authcookie not defined\" }}");
|
||||
Assert.That(AuthcookieNotDefinedException.IsAuthcookieNotDefined(response, "Test context", out AuthcookieNotDefinedException exception),
|
||||
Is.EqualTo(true));
|
||||
|
||||
Assert.That(exception, !Is.Null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestIsAuthcookieNotDefined_False()
|
||||
{
|
||||
var response = JsonConvert.DeserializeObject<ResponseBase>($"{{ \"response_state\" : \"Failure 1001: authcookie not defined\" }}");
|
||||
Assert.That(AuthcookieNotDefinedException.IsAuthcookieNotDefined(response, "Test context", out AuthcookieNotDefinedException exception),
|
||||
Is.EqualTo(true));
|
||||
|
||||
Assert.That(exception, !Is.Null);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue