Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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));
 }