public async Task CreateProductCategoryAsyncShouldCreateBlogCategorySuccessfully() { var options = new DbContextOptionsBuilder <MyCalisthenicAppDbContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) .Options; var dbContext = new MyCalisthenicAppDbContext(options); var categoriesService = new CategoriesService(dbContext, null); var categoryInputModel = new ProductCategoryAdminCreateViewModel { Name = CategoryName, }; await categoriesService.CreateProductCategoryAsync(categoryInputModel); var actual = dbContext.ProductCategories.FirstOrDefaultAsync(bc => bc.Name == CategoryName); Assert.Equal(actual.Result.Name, CategoryName); }