public void HaveChampion() { List <Movie> moviesExpected = new List <Movie>() { new Movie() { titulo = "Beyblade", nota = 2 }, new Movie() { titulo = "Destructive", nota = 4 }, new Movie() { titulo = "Avengers", nota = 3 }, new Movie() { titulo = "Cars", nota = 5 } }; ChampionshipBus championshipBus = new ChampionshipBus(); championshipBus.RankedList(moviesExpected); }
public async Task <ActionResult <List <Movie> > > Post([FromBody] List <Movie> movies) { ChampionshipBus championshipBus = new ChampionshipBus(); var rankedMovies = await championshipBus.RankedList(movies); return(rankedMovies); }
public async void HaveToWinWhoHasHighestGrade() { Movie movieA = new Movie() { nota = 2 }; Movie movieB = new Movie() { nota = 5 }; ChampionshipBus championshipBus = new ChampionshipBus(); Movie winningMovie = await championshipBus.GetWinner(movieA, movieB); movieB.ToExpectedObject().ShouldMatch(winningMovie); }
public async void ChampionshipHasToHaveEqualEightMovies(int quantityElements) { int numberParticipants = 8; List <Movie> movies = new List <Movie>(); for (int i = 0; i < quantityElements; i++) { movies.Add(new Movie()); } ChampionshipBus championshipBus = new ChampionshipBus(); var message = Assert.ThrowsAsync <InvalidOperationException>(() => championshipBus.ValidListQuantity(movies)).Result.Message; Assert.Equal(message, Message.Message.ChampionshipMessage.NumberParticipantsShouldBeEqual(numberParticipants)); }
public async void HaveToWinWhoHasTitleFirstInAlphabeticalOrder() { Movie movieA = new Movie() { nota = 3, titulo = "Beethoven" }; Movie movieB = new Movie() { nota = 3, titulo = "Assassins Creed" }; ChampionshipBus championshipBus = new ChampionshipBus(); Movie winningMovie = await championshipBus.GetWinner(movieA, movieB); movieB.ToExpectedObject().ShouldMatch(winningMovie); }