Ejemplo n.º 1
0
        public void DeleteByPOST_WhenExecuteCorrectly_RemoveTheCompetitionFromTheRepository()
        {
            var competition           = new Competition();
            var competitionRepository = new CompetitionRepository {
                QueryableSession = new InMemoryQueryableSession <Competition>()
            };

            competitionRepository.Add(competition);

            var controller = new CompetitionController();

            controller.CompetitionRepository = competitionRepository;
            controller.Delete(competition.Id, new FormCollection());

            Assert.IsFalse(competitionRepository.Contains(competition), "The competition should have been removed from the repository");
        }
        public void DeleteByPOST_WhenExecuteCorrectly_RemoveTheCompetitionFromTheRepository()
        {
            var competition = new Competition();
            var competitionRepository = new CompetitionRepository { QueryableSession = new InMemoryQueryableSession<Competition>() };
            competitionRepository.Add(competition);

            var controller = new CompetitionController();
            controller.CompetitionRepository = competitionRepository;
            controller.Delete(competition.Id, new FormCollection());

            Assert.IsFalse(competitionRepository.Contains(competition),"The competition should have been removed from the repository");
        }