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,69 @@
|
|||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.Services.CopriApi.ServerUris;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCopriServerUriList
|
||||
{
|
||||
[Test]
|
||||
public void TestConstruct()
|
||||
{
|
||||
var l_oUri = new CopriServerUriList();
|
||||
|
||||
Assert.Greater(l_oUri.Uris.Count, 0, "There must be at least one uri");
|
||||
Assert.NotNull(l_oUri.ActiveUri);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestConstruct_AryStringString()
|
||||
{
|
||||
var l_oUri = new CopriServerUriList(
|
||||
(new List<Uri> { new Uri("http://1.2.3.4"), new Uri("http://2.3.4.5"), new Uri("http://3.4.5.6") }).ToArray(),
|
||||
new Uri("http://2.3.4.5"));
|
||||
|
||||
Assert.AreEqual(3, l_oUri.Uris.Count);
|
||||
Assert.AreEqual(new Uri("http://2.3.4.5"), l_oUri.ActiveUri);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestConstruct_AryStringString_NullList()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => new CopriServerUriList(
|
||||
null,
|
||||
new Uri("http://2.3.4.5")));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestConstruct_AryStringString_InvalidList()
|
||||
{
|
||||
Assert.Throws<ArgumentException>( () => new CopriServerUriList(
|
||||
(new List<Uri>()).ToArray(),
|
||||
new Uri("http://2.3.4.5")));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestConstruct_AryStringString_InvalidActiveUri()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => new CopriServerUriList(
|
||||
(new List<Uri> { new Uri("http://1.2.3.4"), new Uri("http://2.3.4.5"), new Uri("http://3.4.5.6") }).ToArray(),
|
||||
new Uri("http://9.9.9.9")));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestDefaultActiveUri()
|
||||
{
|
||||
Assert.AreEqual(
|
||||
"https://shareeapp-primary.copri.eu/APIjsonserver",
|
||||
CopriServerUriList.DefaultActiveUri.AbsoluteUri,
|
||||
"In production environment, server address must always be app.tink-konstanz.de/APIjsonserver.");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue