mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-07-07 12:06:43 +02:00
Version 3.0.381
This commit is contained in:
parent
f963c0a219
commit
3a363acf3a
1525 changed files with 60589 additions and 125098 deletions
|
@ -0,0 +1,64 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using ShareeBike.Model.Services.CopriApi.ServerUris;
|
||||
|
||||
namespace SharedBusinessLogic.Tests.Fixtures.ObjectTests.Connector
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCopriServerUriList
|
||||
{
|
||||
[Test]
|
||||
public void TestConstruct()
|
||||
{
|
||||
var l_oUri = new CopriServerUriList();
|
||||
|
||||
Assert.That(l_oUri.Uris.Count, Is.GreaterThan(0), "There must be at least one uri");
|
||||
Assert.That(l_oUri.ActiveUri, Is.Not.Null);
|
||||
}
|
||||
|
||||
[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.That(l_oUri.Uris.Count, Is.EqualTo(3));
|
||||
Assert.That(l_oUri.ActiveUri, Is.EqualTo(new Uri("http://2.3.4.5")));
|
||||
}
|
||||
|
||||
[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.That(
|
||||
CopriServerUriList.DefaultActiveUri.AbsoluteUri, Is.EqualTo("https://shareeapp-primary.copri.eu/APIjsonserver"),
|
||||
"In production environment, server address must always be app.tink-konstanz.de/APIjsonserver.");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue