コード例 #1
0
        public async Task FindAsync_10_ReturnsValidSubcategory()
        {
            // Arrange
            const int expectedId = SubcategoriesCount;

            // Act
            var subcategory = await _subcategoryService.FindAsync(expectedId);

            // Assert
            Assert.NotNull(subcategory);
            Assert.Equal(expectedId, subcategory.Id);
        }
コード例 #2
0
        public async Task <SubcategoryView> Get(int id)
        {
            var subcategory = await _subcategoryService.FindAsync(id);

            return(_mapper.Map <SubcategoryView>(subcategory));
        }