public async Task Should_Add_New_User() { // Arrange var user = new UserEntity(Guid.NewGuid().ToString(), "firstname", "lastname", "email", DateTime.Now) { Expenses = new List <ExpenseEntity> { new ExpenseEntity( "id", 123U, "something", "somewhere", DateTime.Now, DateTime.Now), }, }; // Act await _repo.Add(user); // Assert var users = await _repo.GetAll(); var actual = users.FirstOrDefault(u => u.Id == user.Id); Assert.NotNull(actual); }
public async Task InitializeAsync() { var user = new UserEntity(_userId, "firstname", "lastname", "email", DateTime.Now) { Expenses = new List <ExpenseEntity>(), }; await _userRepo.Add(user); }