public List <Badge> GetAllBadges() { try { return(_service.GetAllBadges()); } catch (Exception e) { throw e; } }
public IHttpActionResult AllBadges() { var badges = _badgeService.GetAllBadges(); if (badges != null) { var badgeDTOs = badges as List <BadgeDTO> ?? badges.ToList(); if (badgeDTOs.Any()) { return(Ok(badgeDTOs)); } } return(NotFound()); }
public void WhenGettingAllBadges_AssertReturnedCollection() { var badges = _badgeService.GetAllBadges(); Assert.Equal(DataInitializer.GetAllBadges().Count, badges.Count()); }