using System; using System.Collections.Generic; using NUnit.Framework; namespace UITest.Fixtures.ObjectTests.User.Account { [TestFixture] public class TestAccount { [Test] public void TestConstruct() { // Act var account = new ShareeBike.Model.User.Account.Account( "hans.musterman@hotmail.com", // Mail "myPasswd", // Pwd false, "aktuellerKeks", // Cookie new List { "Honkey", "Tonkey" }, // Group ShareeBike.Model.User.Account.Permissions.None); // Assert Assert.That(account.Mail, Is.EqualTo("hans.musterman@hotmail.com")); Assert.That(account.Pwd, Is.EqualTo("myPasswd")); Assert.That(account.IsAgbAcknowledged, Is.False); Assert.That(account.SessionCookie, Is.EqualTo("aktuellerKeks")); Assert.That(String.Join(",", account.Group), Is.EqualTo("Honkey,Tonkey")); Assert.That(account.DebugLevel, Is.EqualTo(ShareeBike.Model.User.Account.Permissions.None)); } [Test] public void TestConstruct_Copy() { var account = new ShareeBike.Model.User.Account.Account(new ShareeBike.Model.User.Account.Account( "a@b", "112", true, // Agbs have been acknowledged "3330", new List { "Honkey", "Tonkey" }, ShareeBike.Model.User.Account.Permissions.None)); Assert.That(account.Mail, Is.EqualTo("a@b")); Assert.That(account.Pwd, Is.EqualTo("112")); Assert.That(account.IsAgbAcknowledged, Is.True); Assert.That(account.SessionCookie, Is.EqualTo("3330")); Assert.That(String.Join(",", account.Group), Is.EqualTo("Honkey,Tonkey")); Assert.That(account.DebugLevel, Is.EqualTo(ShareeBike.Model.User.Account.Permissions.None)); } [Test] public void TestConstruct_InvalidGroup() { Assert.Throws(() => new ShareeBike.Model.User.Account.Account("a@b", "112", false, "3330", null, ShareeBike.Model.User.Account.Permissions.None)); Assert.Throws(() => new ShareeBike.Model.User.Account.Account(null)); } } }