예제 #1
0
 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;
 }
예제 #2
0
        public MainTabViewModel(UserInfo loggedInuserInfo)
        {
            this._loggedInUserInfo = loggedInuserInfo;
            
            _container = new WindsorContainer();
            _container.Install(FromAssembly.Containing<Installers>());

            this.LoadValidTabsBasedOnUser();
        }
예제 #3
0
        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();
        }
예제 #5
0
 public void AddUser(UserInfo userInfo)
 {
     this.savedUserInfos.Add(userInfo);
 }
예제 #6
0
 public void UpdateUserInfo(UserInfo userInfo, string username, string password)
 {
  
 }
예제 #7
0
 private UserPasswordCtrl CreateUserPasswordCtrl(UserInfo userInfo)
 {
     var userPasswordCtrl = new UserPasswordCtrl(userInfo);
     return userPasswordCtrl;
 }
예제 #8
0
 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)));
        }
예제 #10
0
        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();
        }
예제 #11
0
 public void SetLoggedInUser(UserInfo userInfo)
 {
     logger.Info("Logged in user" + userInfo.Name);
     this._loggedInUser = userInfo;
 }
예제 #12
0
 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);
 }
예제 #13
0
 public void AddUsers(UserInfo userInfo)
 {
     logger.Info("Adding User" + userInfo.Name);
     this.UserProvider.AddUser(userInfo);
     logger.Info("Done Adding User" + userInfo.Name);
 }