public async void AddClubToStadiumSuccess() { var options = new DbContextOptionsBuilder <SoccerManagerContext>().UseInMemoryDatabase("SoccerManager").Options; var context = new SoccerManagerContext(options); var ClubsController = new ClubsController(context); var StadiumsController = new StadiumsController(context); Stadium new_stadium = new Stadium() { Name = "Emirates Stadium", Location = "London Borough of Islington, London, UK" }; await StadiumsController.PostStadium(new_stadium); Club new_club = new Club() { Name = "Arsenal" }; await ClubsController.PostClub(new_club); await StadiumsController.AddClubToStadium(new_stadium.StadiumId, new_club.ClubId); Assert.True(new_club.Stadium.StadiumId == new_stadium.StadiumId); }
public async void AddStadiumSucces() { var options = new DbContextOptionsBuilder <SoccerManagerContext>().UseInMemoryDatabase("SoccerManager").Options; var context = new SoccerManagerContext(options); var StadiumsController = new StadiumsController(context); Stadium new_stadium = new Stadium() { Name = "Emirates Stadium", Location = "London Borough of Islington, London, UK" }; await StadiumsController.PostStadium(new_stadium); Assert.True(new_stadium.StadiumId > 0); }