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);
        }
示例#2
0
 public ActionResult <IEnumerable <Hero> > Get([FromQuery(Name = "name")] string name)
 {
     if (name == null)
     {
         return(Ok(service.GetHeroes()));
     }
     else
     {
         return(Ok(service.SearchHeroes(name)));
     }
 }
示例#3
0
 public ActionResult <string[]> Get()
 {
     return(_heroesService.GetHeroes());
 }