public async Task CategoryDetailsTest()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options;
            var dbContext = new ApplicationDbContext(options);

            dbContext.Categories.Add(new Category
            {
                Id       = 1,
                Name     = "First",
                Products = new List <Product>
                {
                    new Product
                    {
                        Id         = 1,
                        ImageUrl   = "Test1",
                        Name       = "Test1",
                        Price      = 5,
                        Quantity   = 3,
                        CategoryId = 1,
                        Ratings    = new List <Rating>
                        {
                            new Rating
                            {
                                Grade = Grade.VeryGood,
                            },
                        },
                    },
                    new Product
                    {
                        Id         = 2,
                        ImageUrl   = "Test2",
                        Name       = "Test2",
                        Price      = 5,
                        Quantity   = 3,
                        CategoryId = 1,
                        Ratings    = new List <Rating>
                        {
                            new Rating
                            {
                                Grade = Grade.VeryGood,
                            },
                            new Rating
                            {
                                Grade = Grade.VeryBad,
                            },
                        },
                    },
                    new Product
                    {
                        Id         = 3,
                        ImageUrl   = "Test3",
                        Name       = "Test3",
                        Price      = 5,
                        Quantity   = 3,
                        CategoryId = 1,
                        Ratings    = new List <Rating>
                        {
                            new Rating
                            {
                                Grade = Grade.VeryGood,
                            },
                        },
                    },
                    new Product
                    {
                        Id         = 4,
                        ImageUrl   = "Test3",
                        Name       = "Test3",
                        Price      = 5,
                        Quantity   = 0,
                        CategoryId = 1,
                        Ratings    = new List <Rating>
                        {
                            new Rating
                            {
                                Grade = Grade.VeryGood,
                            },
                        },
                    },
                },
                Subcategories = new List <Subcategory>
                {
                    new Subcategory
                    {
                        Id         = 1,
                        Name       = "Test1",
                        CategoryId = 1,
                    },
                    new Subcategory
                    {
                        Id         = 2,
                        Name       = "Test2",
                        CategoryId = 1,
                    },
                    new Subcategory
                    {
                        Id         = 3,
                        Name       = "Test3",
                        CategoryId = 1,
                    },
                },
            });
            await dbContext.SaveChangesAsync();

            var repository   = new EfDeletableEntityRepository <Category>(dbContext);
            var service      = new CategoriesService(repository);
            var detailsModel = service.CategoryDetails("First", 3, 1);

            Assert.Equal(typeof(NameAndSubcategoriesNamesViewModel), detailsModel.GetType());
            Assert.Equal(typeof(SubcategoryNameViewModel), detailsModel.Subcategories.First().GetType());
            Assert.Equal(typeof(SummaryProductModel), detailsModel.Products.FirstOrDefault().GetType());
            Assert.Equal(3, detailsModel.Products.Where(a => a.Id == 2).First().AverageRating);
            Assert.Equal(2, detailsModel.Products.Count());
            Assert.Contains(detailsModel.Subcategories, a => a.Id == 1 && a.Name == "Test1");
            Assert.Equal("First", detailsModel.Name);
        }