예제 #1
0
 private User CreateUser()
 {
     _user       = EntityHelpers.CreateUser();
     _userDomain = _usersGateway.AddUser(_mapper.ToDomain(_user));
     _user       = _mapper.FromDomain(_userDomain);
     return(_user);
 }
예제 #2
0
 public void GivenInvalidUserIdOnCreateExceptionWillBeThrown()
 {
     _user    = EntityHelpers.CreateUser();
     _user.Id = 999999999;
     _classUnderTest.Invoking(c => c.LinkUserToOrganisation(CreateOrganisation().Id, _user.Id))
     .Should()
     .Throw <Exception>();
 }
예제 #3
0
        public void CanGetAUserEntity()
        {
            var user = EntityHelpers.CreateUser();

            DatabaseContext.Add(user);
            DatabaseContext.SaveChanges();
            var result = DatabaseContext.Users.ToList().FirstOrDefault();

            result.Should().BeEquivalentTo(user);
        }