public async Task <CommandResult> ExecuteAsync(CommandsHandler handler) { var obj = new Championship(); obj.AddMovies(Movies); obj.GenerateQuartersFinals(); obj.PlayQuarterFinals(); obj.GenerateSemiFinals(); obj.PlaySemiFinals(); obj.GenerateFinals(); obj.PlayFinals(); var rs = new List <Movie>(); rs.Add(obj.First); rs.Add(obj.Second); return(await Task.FromResult(new CommandResult(rs))); }
public void AddMoviesTest() { var obj = new Championship(); var movies = GetMovies(); obj.AddMovies(movies); Assert.AreEqual(obj.AllMovies.Count(), 8); obj = new Championship(); obj.AddMovie(movies.ElementAt(0)); Assert.AreEqual(obj.AllMovies.Count(), 1); try { obj.AddMovies(movies); Assert.Fail("no exception thrown"); } catch (Exception ex) { Assert.IsTrue(ex is InvalidOperationException); } }
public void AddMovies(Championship obj) { obj.AddMovies(GetMovies()); }