public IHttpActionResult AllBadgeTypes() { var badgeTypes = _badgeService.GetAllBadgeTypes(); if (badgeTypes != null) { var badgeTypeDTOs = badgeTypes as List <BadgeTypeDTO> ?? badgeTypes.ToList(); if (badgeTypeDTOs.Any()) { return(Ok(badgeTypeDTOs)); } } return(NotFound()); }
public void WhenGettingAllBadgeTypes_AssertReturnedCollection() { var badgeTypes = _badgeService.GetAllBadgeTypes(); Assert.Equal(DataInitializer.GetAllBadgeTypes().Count, badgeTypes.Count()); }