public void Delete_ShouldRemoveSpecifiedHero_WhenExistingIdPassed() { int id = 4; ActionResult <Hero> res = controller.Delete(id); List <Hero> heroes = service.GetHeroes() as List <Hero>; Assert.Equal(3, heroes.Count); }
public ActionResult <IEnumerable <Hero> > Get([FromQuery(Name = "name")] string name) { if (name == null) { return(Ok(service.GetHeroes())); } else { return(Ok(service.SearchHeroes(name))); } }
public ActionResult <string[]> Get() { return(_heroesService.GetHeroes()); }