public void UpdateUserInfo(UserInfo userInfo, string username, string password) { var users = this.GetUsersList(); var foundUserInfo = users.Find(item => item.ID == userInfo.ID); foundUserInfo.Password = password; foundUserInfo.Name = username; }
public MainTabViewModel(UserInfo loggedInuserInfo) { this._loggedInUserInfo = loggedInuserInfo; _container = new WindsorContainer(); _container.Install(FromAssembly.Containing<Installers>()); this.LoadValidTabsBasedOnUser(); }
public void TestTabsConstructForOperatorMode() { var userInfo = new UserInfo() { Role = Roles.Operator }; UserManager.Instance.SetLoggedInUser(userInfo); var mainTabViewModel = new MainTabViewModel(userInfo); var tabs = mainTabViewModel.Tabs; Assert.AreEqual(tabs.Count, 2); }
public UserPasswordCtrl(UserInfo userInfo) { InitializeComponent(); this.UserInfo = userInfo; this.UserNameTxt = userInfo.Name; this.PasswordTxt = userInfo.Password; this.RoleText = userInfo.Role.ToString(); this.DisablePasswordForSuperIfNotDeveloper(); }
public void AddUser(UserInfo userInfo) { this.savedUserInfos.Add(userInfo); }
public void UpdateUserInfo(UserInfo userInfo, string username, string password) { }
private UserPasswordCtrl CreateUserPasswordCtrl(UserInfo userInfo) { var userPasswordCtrl = new UserPasswordCtrl(userInfo); return userPasswordCtrl; }
public void AddUser(UserInfo userInfo) { this.GetUsersList().Add(userInfo); }
public void TestUpdateUserInfo() { const string expectedUser = "******"; const string expectedNewUser = "******"; const string expectedOldPassword = "******"; const string expectedNewPassword = "******"; var binUserProvider = this.constructBinaryUserProvider(); var userInfo = new UserInfo {Name = expectedUser, Password = expectedOldPassword, Role = Roles.Developer}; binUserProvider.AddUser(userInfo); binUserProvider.UpdateUserInfo(userInfo, expectedNewUser, expectedNewPassword); var users = binUserProvider.GetUsersList(); Assert.IsTrue(users.Any(item => (item.Name == expectedNewUser && item.Password == expectedNewPassword))); Assert.IsFalse(users.Any(item => (item.Name == expectedNewUser && item.Password == expectedOldPassword))); }
public void SetLoggedInUser(string userName) { logger.Info("Logged in user" + userName); var users = this.GetUsersList(); var info = from userInfo in users where userInfo.Name == userName select userInfo; this._loggedInUser = info.FirstOrDefault(); }
public void SetLoggedInUser(UserInfo userInfo) { logger.Info("Logged in user" + userInfo.Name); this._loggedInUser = userInfo; }
public void UpdateUserInfo(UserInfo userInfo, string username, string password) { logger.Info("Updating User" + userInfo.Name); this.UserProvider.UpdateUserInfo(userInfo, username, password); logger.Info("Updated User" + userInfo.Name); }
public void AddUsers(UserInfo userInfo) { logger.Info("Adding User" + userInfo.Name); this.UserProvider.AddUser(userInfo); logger.Info("Done Adding User" + userInfo.Name); }