public void RetreiveUserInfoTest() { Assert.That(AccountExists(emailAddress), Is.False); var peterAccount = new Majorsilence.Vpn.Logic.Accounts.CreateAccount( new Majorsilence.Vpn.Logic.Accounts.CreateAccountInfo() { Email = emailAddress, EmailConfirm = emailAddress, Firstname = "Peter", Lastname = "Gill", Password = "******", PasswordConfirm = "Password1", BetaKey = "" } , false, Majorsilence.Vpn.Logic.InitializeSettings.Email); var userid = peterAccount.Execute(); Assert.That(AccountExists(emailAddress), Is.True); var info = new Majorsilence.Vpn.Logic.Accounts.UserInfo(userid); var profile = info.GetProfile(); Assert.That("Peter", Is.EqualTo(profile.FirstName)); Assert.That("Gill", Is.EqualTo(profile.LastName)); Assert.That(emailAddress, Is.EqualTo(profile.Email)); Assert.That(false, Is.EqualTo(profile.Admin)); Assert.That(false, Is.EqualTo(profile.IsBetaUser)); }
public void UpdateUserInfoInvalidEmailTest() { Assert.That(AccountExists(emailAddress), Is.False); var peterAccount = new Majorsilence.Vpn.Logic.Accounts.CreateAccount( new Majorsilence.Vpn.Logic.Accounts.CreateAccountInfo() { Email = emailAddress, EmailConfirm = emailAddress, Firstname = "Peter", Lastname = "Gill", Password = "******", PasswordConfirm = "Password1", BetaKey = "" } , false, Majorsilence.Vpn.Logic.InitializeSettings.Email); var userid = peterAccount.Execute(); Assert.That(AccountExists(emailAddress), Is.True); var info = new Majorsilence.Vpn.Logic.Accounts.UserInfo(userid); var profile = info.GetProfile(); Assert.Throws <Majorsilence.Vpn.Logic.Exceptions.InvalidDataException>(() => info.UpdateProfile("", "Happy", "Dude")); }