public async Task GetAllUsers_Ok() { var users = userFakedata.GetAllUsersModel(); userActionMock.Setup(u => u.GetAll()) .ReturnsAsync(users); var usersResponse = users.Select(u => userFormatter.ToUserResponse(u)).ToList(); var domain = new UserDomain(userActionMock.Object); var result = await domain.GetAll(); Assert.IsNotNull(result); for (int i = 0; i < result.Count; i++) { Assert.AreEqual(result[i].Id, usersResponse[i].Id); Assert.AreEqual(result[i].FirstName, usersResponse[i].FirstName); Assert.AreEqual(result[i].LastName, usersResponse[i].LastName); Assert.AreEqual(result[i].Email, usersResponse[i].Email); } }
public async Task <List <UserResponse> > GetAll() { var users = await userAction.GetAll(); return(users.Select(u => userFormatter.ToUserResponse(u)).ToList()); }