private void SetAdminFlag(ref Account account) { if (account != null) { account.Access = _accountSettings.IsAdmin(account) ? AccessType.Admin : account.Access; } }
public void AdminUsernameReturnsTrue() { var goodAccount = new Account() { Name = "*****@*****.**" }; var badAccount = new Account() { Name = "*****@*****.**" }; var settings = new AccountSettings { AdminList = goodAccount.Name }; Assert.IsTrue(settings.IsAdmin(goodAccount)); Assert.IsFalse(settings.IsAdmin(badAccount)); }