mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.270
This commit is contained in:
parent
67999ef4ae
commit
e0c75d5b37
81 changed files with 812 additions and 474 deletions
|
@ -1,5 +1,6 @@
|
|||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using System;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Repository;
|
||||
|
||||
|
@ -18,6 +19,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
|
||||
// Construct not logged in version of connector.
|
||||
var l_oCommand = new ConnectorCache(
|
||||
new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)),
|
||||
"", // Not logged in
|
||||
"",
|
||||
l_oCopri).Command;
|
||||
|
@ -34,6 +36,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
var l_oCopri = MockRepository.GenerateStub<ICopriServer>();
|
||||
|
||||
var l_oCommand = new ConnectorCache(
|
||||
new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)),
|
||||
"123", // Logged in
|
||||
"a@b",
|
||||
l_oCopri).Command;
|
||||
|
@ -50,6 +53,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
var l_oCopri = MockRepository.GenerateStub<ICopriServer>();
|
||||
|
||||
var l_oQuery = new ConnectorCache(
|
||||
new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)),
|
||||
"",
|
||||
"",
|
||||
l_oCopri).Query;
|
||||
|
@ -66,6 +70,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
var l_oCopri = MockRepository.GenerateStub<ICopriServer>();
|
||||
|
||||
var l_oQuery = new ConnectorCache(
|
||||
new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)),
|
||||
"123",
|
||||
"a@b",
|
||||
l_oCopri).Query;
|
||||
|
|
|
@ -5,6 +5,7 @@ using TINK.Model.Connector;
|
|||
using System.Linq;
|
||||
using TINK.Repository;
|
||||
using TestFramework.Repository;
|
||||
using System;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
||||
{
|
||||
|
@ -17,6 +18,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
public void TestGetStationsAll()
|
||||
{
|
||||
var connector = new ConnectorCache(
|
||||
new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)),
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory001());
|
||||
|
@ -51,6 +53,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
public void TestGetBikesAll()
|
||||
{
|
||||
var l_oConnector = new ConnectorCache(
|
||||
new AppContextInfo("MyMerchId", "MyApp", new Version(1, 2)),
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory001());
|
||||
|
|
|
@ -614,5 +614,56 @@ namespace TestTINKLib.Fixtures.Connector
|
|||
() => version.GetCopriVersion(),
|
||||
Throws.InstanceOf<InvalidResponseException>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGetIsAgbAcknowledged()
|
||||
{
|
||||
var response = JsonConvertRethrow.DeserializeObject<AuthorizationResponse>(@"
|
||||
{
|
||||
""agb_checked"" : ""1""
|
||||
}");
|
||||
|
||||
Assert.That(
|
||||
() => response.GetIsAgbAcknowledged(),
|
||||
Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGetIsAgbAcknowledged_No()
|
||||
{
|
||||
var response = JsonConvertRethrow.DeserializeObject<AuthorizationResponse>(@"
|
||||
{
|
||||
""agb_checked"" : ""0""
|
||||
}");
|
||||
|
||||
Assert.That(
|
||||
() => response.GetIsAgbAcknowledged(),
|
||||
Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGetIsAgbAcknowledged_Invalid()
|
||||
{
|
||||
var response = JsonConvertRethrow.DeserializeObject<AuthorizationResponse>(@"
|
||||
{
|
||||
""agb_checked"" : ""ä""
|
||||
}");
|
||||
|
||||
Assert.That(
|
||||
() => response.GetIsAgbAcknowledged(),
|
||||
Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGetIsAgbAcknowledged_Empty()
|
||||
{
|
||||
var response = JsonConvertRethrow.DeserializeObject<AuthorizationResponse>(@"
|
||||
{
|
||||
}");
|
||||
|
||||
Assert.That(
|
||||
() => response.GetIsAgbAcknowledged(),
|
||||
Is.False);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue