public void SaveUserShouldCallRepository() { UserDto userDto = new UserDto(); m_UserRepositoryMock = new Mock<IUserRepository>(); m_BetRepositoryMock = new Mock<IBetRepository>(); m_MatchRepositoryMock = new Mock<IMatchRepository>(); m_UserService = new UserService(m_UserRepositoryMock.Object, m_BetRepositoryMock.Object, m_MatchRepositoryMock.Object); m_UserService.CreateUser(userDto); m_UserRepositoryMock.Verify(x => x.PersistUser(It.IsAny<User>()), Times.Once); }
public async Task CreateUser(UserDto user) { await m_UserRepository.PersistUser(Mapper.Map<User>(user)).ConfigureAwait(false); }
public async Task<HttpResponseMessage> Create(UserDto user) { await m_UserSevice.CreateUser(user).ConfigureAwait(false); return Request.CreateResponse(HttpStatusCode.Created); }