2022-08-30 15:42:25 +02:00
|
|
|
|
using System;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
using System.Collections.Generic;
|
2022-08-30 15:42:25 +02:00
|
|
|
|
using NUnit.Framework;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
|
|
|
|
namespace UITest.Fixtures.ObjectTests.User.Account
|
|
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TestAccount
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestConstruct()
|
|
|
|
|
{
|
|
|
|
|
// Act
|
|
|
|
|
var account = new TINK.Model.User.Account.Account(
|
|
|
|
|
"hans.musterman@hotmail.com", // Mail
|
|
|
|
|
"myPasswd", // Pwd
|
|
|
|
|
false,
|
|
|
|
|
"aktuellerKeks", // Cookie
|
|
|
|
|
new List<string> { "Honkey", "Tonkey" }, // Group
|
|
|
|
|
TINK.Model.User.Account.Permissions.None);
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
// Assert
|
|
|
|
|
Assert.AreEqual("hans.musterman@hotmail.com", account.Mail);
|
|
|
|
|
Assert.AreEqual("myPasswd", account.Pwd);
|
|
|
|
|
Assert.That(account.IsAgbAcknowledged, Is.False);
|
|
|
|
|
Assert.AreEqual("aktuellerKeks", account.SessionCookie);
|
|
|
|
|
Assert.AreEqual("Honkey,Tonkey", String.Join(",", account.Group));
|
|
|
|
|
Assert.AreEqual(TINK.Model.User.Account.Permissions.None, account.DebugLevel);
|
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
[Test]
|
|
|
|
|
public void TestConstruct_Copy()
|
|
|
|
|
{
|
|
|
|
|
var account = new TINK.Model.User.Account.Account(new TINK.Model.User.Account.Account(
|
|
|
|
|
"a@b",
|
|
|
|
|
"112",
|
|
|
|
|
true, // Agbs have been acknowledged
|
|
|
|
|
"3330",
|
|
|
|
|
new List<string> { "Honkey", "Tonkey" },
|
|
|
|
|
TINK.Model.User.Account.Permissions.None));
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
Assert.AreEqual("a@b", account.Mail);
|
|
|
|
|
Assert.AreEqual("112", account.Pwd);
|
|
|
|
|
Assert.That(account.IsAgbAcknowledged, Is.True);
|
|
|
|
|
Assert.AreEqual("3330", account.SessionCookie);
|
|
|
|
|
Assert.AreEqual("Honkey,Tonkey", String.Join(",", account.Group));
|
|
|
|
|
Assert.AreEqual(TINK.Model.User.Account.Permissions.None, account.DebugLevel);
|
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
[Test]
|
|
|
|
|
public void TestConstruct_InvalidGroup()
|
|
|
|
|
{
|
|
|
|
|
Assert.Throws<ArgumentException>(() => new TINK.Model.User.Account.Account("a@b", "112", false, "3330", null, TINK.Model.User.Account.Permissions.None));
|
|
|
|
|
Assert.Throws<ArgumentException>(() => new TINK.Model.User.Account.Account(null));
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
}
|