public void LoginShouldBeOk() { _userServiceMock.Setup(service => service.Login(It.IsAny <string>(), It.IsAny <string>())).Returns(ResponseDTO <UserDTO> .Ok(new UserDTO())); var response = _operativeServices.Login("test", "test"); Assert.IsTrue(response.Success); Assert.AreEqual(ResponseCode.Ok, response.Code); }
/// <summary> /// Login for the given username and password. /// </summary> /// <returns>The authorized user if login is successful.</returns> /// <param name="pUsername">Username.</param> /// <param name="pPassword">Password.</param> public ResponseDTO <UserDTO> Login(string pUsername, string pPassword) { ResponseDTO <UserDTO> response = _operativeService.Login(pUsername, pPassword); if (response.Success) { LoggedUser = response.Data; } return(response); }