public void update_not_exists_admin() { Init(); // TEST: add new Admins without email to db Admins.AddOrUpdate(item_with_valid_data); //Assert.ThrowsException<KeyNotFoundException>(() => //{ //}); }
private static void Interpreter_OnSetUserPassword(string UserName) { try { Admins Item = Admins.GetUserByLogin(UserName); if (Item == null) { System.Console.WriteLine(string.Format("User {0} not found", UserName)); return; } System.Console.WriteLine(string.Format("Enter new password for user {0}:", UserName)); Item.Password = InputPassword(); Admins.AddOrUpdate(Item); } catch (Exception ex) { System.Console.WriteLine($"Set user password error: {ex}"); Logger.Error(ex, "Set user password error"); } }