Exemple #1
0
        public async Task AddAsyncShouldAddCorrectly()
        {
            await this.CreateCategoryAsync();

            var name        = new NLipsum.Core.Sentence().ToString();
            var description = new NLipsum.Core.Paragraph().ToString();

            await this.Service.AddAsync(name, description);

            var categoriesCount = await this.DbContext.Categories.CountAsync();

            Assert.Equal(2, categoriesCount);
        }
        public async Task AddAsyncShouldAddCorrectly()
        {
            await this.CreateBlogPostAsync();

            var title    = new NLipsum.Core.Sentence().ToString();
            var content  = new NLipsum.Core.Paragraph().ToString();
            var author   = new NLipsum.Core.Word().ToString();
            var imageUrl = new NLipsum.Core.Word().ToString();

            await this.Service.AddAsync(title, content, author, imageUrl);

            var blogPostsCount = await this.DbContext.BlogPosts.CountAsync();

            Assert.Equal(2, blogPostsCount);
        }