public async Task Should_Remove_Item_If_It_Exists() { //Arrange const int id = 100; var festival = new Festival { Name = "Test", Description = "TestDescription", Id = id }; await _repository.AddFestival(festival); //Act await _service.RemoveFestival(id); //Assert Assert.IsFalse(await _repository.IsExist(id)); }
public async void RemoveFestivalShouldRemoveFestival(int festivalId) { await _festivalService.RemoveFestival(festivalId); await Assert.ThrowsAsync <EntityNotFoundException>(() => _festivalService.RemoveFestival(festivalId)); }
public async Task <ActionResult> DeleteFestival(int id) { await _service.RemoveFestival(id); return(NoContent()); }