public void LogInSuccessfullyTest() { LoginDTO loginUser = new LoginDTO(); loginUser.UserName = "******"; loginUser.Password = "******"; UserDTO userDTO = new UserDTO(); userDTO.Name = "Pepe"; userDTO.LastName = "Perez"; userDTO.UserName = "******"; userDTO.Phone = 091234567; userDTO.Password = "******"; userDTO.Role = "Administrador"; var mockUserDAO = new Mock <UserDAO>(); mockUserDAO.Setup(us => us.LogIn(loginUser)).Returns(userDTO); var userService = new UserServiceImpl(mockUserDAO.Object); UserLoggedDTO result = userService.LogIn(loginUser); userService.LogOut(result.Token); }
public void LogOutUserErrorTest() { Guid id = Guid.NewGuid(); var userService = new UserServiceImpl(null); userService.LogOut(id); }