Esempio n. 1
0
        public void DeleteTournament_GivenValidID_ShouldRemoveTournament()
        {
            var tournamentID = 1;

            var before = Db.Tournament.ToList().Count;

            _tournamentService.DeleteTournament(tournamentID);
            var after = Db.Tournament.ToList().Count;

            Assert.Less(after, before);
        }
        public async Task <ActionResult> Delete(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            if (await tournamentService.DeleteTournament(id.Value))
            {
                ShowResult(ResultCode.Success, "Delete Tournament", "Tournament is deleted Successful");
            }
            else
            {
                ShowResult(ResultCode.Error, "Delete Tournament", "Tournament is not deleted Successful");
            }

            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
 public Task <TournamentResponseModel> DeleteTournament(int id)
 {
     return(_tournamentService.DeleteTournament(id));
 }