public async Task CreateBlogCategoryAsyncShouldCreateBlogCategorySuccessfully() { 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 BlogCategoryAdminCreateViewModel { Name = CategoryName, }; await categoriesService.CreateBlogCategoryAsync(categoryInputModel); var actual = dbContext.BlogCategories.FirstOrDefaultAsync(bc => bc.Name == CategoryName); Assert.Equal(actual.Result.Name, CategoryName); }