public async Task Register_Should_insert_a_user() { var expected = CreateUser(); await _repository.Insert(expected); var actual = await _repository.GetUserById(expected.Id); Assert.AreEqual(expected, actual); }
public Task AddServiceToUserAsync(TUser user, string serviceId) { if (IsUserRegisteredForService(user, serviceId)) { throw new ArgumentException(string.Format("Service {0} already has been added to user {1}", serviceId, user.Id)); } UserServiceRepository.Insert(new IdentityUserService { ServiceId = serviceId, UserId = user.Id }); return(Task.FromResult(0)); }