예제 #1
0
        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());
        }
예제 #2
0
        public void WhenGettingAllBadgeTypes_AssertReturnedCollection()
        {
            var badgeTypes = _badgeService.GetAllBadgeTypes();

            Assert.Equal(DataInitializer.GetAllBadgeTypes().Count, badgeTypes.Count());
        }