You are not testing anything. You are mocking your system under test which is not correct.
See this answer for a brief explanation of what a mock is.
If you are testing UserManagementService.Login()
you'd want:
[Theory]
[InlineData("manager", "manager")]
public void LoginTest(string userId, string password)
{
// Arrange
// System under test
IUserManagementService userService = new UserManagementService();
var request = new LoginRequest().Prepare();
request.UserId = userId;
request.Password = password;
var expectedResponse = new LoginResponse(request.RequestId);
//Act
var actualResponse = userService.Login(request);
//Assert
Assert.AreEqual(actualResponse.Something, expectedResponse.Something);
}
No need to mock anything. (You may need to mock any dependencies that Login()
has such as AuthenticationService
, userDao
and even Log
if you don't want your unit test to write to the log.)