public void AddUserAndUndoRedo_ShouldMatch() { var addedUser = new ProcessUser { Id = "USER1" }; _userModelManagerMock.Setup(x => x.AddNewUser()).Returns(addedUser).Verifiable(); _userModelManagerMock.Setup(x => x.RemoveUser(addedUser)).Verifiable(); _userModelManagerMock.Setup(x => x.AddUser(addedUser)).Verifiable(); _usersRolesFacade.OnUserAdd(); _userModelManagerMock.Verify(x => x.AddNewUser(), Times.Once); _usersRolesFacade.Undo(); _userModelManagerMock.Verify(x => x.RemoveUser(addedUser), Times.Once); _usersRolesFacade.Redo(); _userModelManagerMock.Verify(x => x.AddUser(addedUser), Times.Once); }
public void HandleKeyDown(object sender, KeyEvent e) { if (e.CtrlKey && e.Key == "z") { UsersRolesFacade.Undo(); StateHasChanged(); } else if (e.CtrlKey && e.Key == "y") { UsersRolesFacade.Redo(); StateHasChanged(); } }