public void CanCreateCupLeague()
        {
            Cup cup = new Cup("Handicap Cup");
            League league = new League(new Season(2008, 2009), "League 1", 1, 1);

            CupLeague cupLeague = new CupLeague(cup, league);

            Assert.That(cupLeague.Cup.CupName, Is.EqualTo(cup.CupName));
            Assert.That(cupLeague.League.Season.StartYear == 2008);
            Assert.That(cupLeague.League.Season.EndYear == 2009);
            Assert.That(cupLeague.League.LeagueDescription == league.LeagueDescription);
        }
        public ActionResult Create(CupLeagueViewModel model)
        {
            if (ModelState.IsValid)
            {
                var cupLeague = new CupLeague(cupService.Get(model.CupId), competitionService.GetLeague(model.LeagueId));

                cupLeagueService.Insert(cupLeague);
                cupLeagueService.Commit();
                SuccessMessage(FormMessages.SaveSuccess);
                return RedirectToAction("Index");
            }

            this.PopulateStaticData(model);

            return View(model);
        }
 public ActionResult Edit(CupLeague @cupLeague)
 {
     if (ModelState.IsValid) {
                 cupLeagueService.Update(@cupLeague);
                 cupLeagueService.Commit();
                 SuccessMessage(FormMessages.SaveSuccess);
                 return RedirectToAction("Index");
         }
         return View(@cupLeague);
 }