public async Task AddMemberToParty() { var options = new DbContextOptionsBuilder <MoviesContext>() .UseInMemoryDatabase(databaseName: "MRAddMemberToParty") .Options; addParties(options); addPartyMembers(options); using (var context = new MoviesContext(options)) { SQLRepository controller = new SQLRepository(context); PartyMember partyMemberToAdd = new PartyMember { Id = 4, PartyId = 2, Email = "*****@*****.**" }; await controller.AddMemberToParty(partyMemberToAdd); List <Party> actual = controller.GetUserParties("*****@*****.**"); Assert.Equal("Second", actual[1].Name); } }