private User CreateUser() { _user = EntityHelpers.CreateUser(); _userDomain = _usersGateway.AddUser(_mapper.ToDomain(_user)); _user = _mapper.FromDomain(_userDomain); return(_user); }
public void GivenInvalidUserIdOnCreateExceptionWillBeThrown() { _user = EntityHelpers.CreateUser(); _user.Id = 999999999; _classUnderTest.Invoking(c => c.LinkUserToOrganisation(CreateOrganisation().Id, _user.Id)) .Should() .Throw <Exception>(); }
public void CanGetAUserEntity() { var user = EntityHelpers.CreateUser(); DatabaseContext.Add(user); DatabaseContext.SaveChanges(); var result = DatabaseContext.Users.ToList().FirstOrDefault(); result.Should().BeEquivalentTo(user); }