Ejemplo n.º 1
0
        public async Task GetPostsForBatchAsync_should_return_4_posts_with_titles_sequence_OH_3_2_1_when_first_batch_ever()
        {
            //arrange
            await TestDataInitializer.Init_1Post(_context, "FutureNH", -100, PostPriority.High);

            await TestDataInitializer.Init_1Post(_context, "FutureN", -100, PostPriority.Normal);

            await TestDataInitializer.Init_1Post(_context, "3", 10, PostPriority.Normal);

            await TestDataInitializer.Init_1Post(_context, "2", 20, PostPriority.Normal);

            await TestDataInitializer.Init_1Post(_context, "OH", 100, PostPriority.High);

            await TestDataInitializer.Init_1Post(_context, "1", 30, PostPriority.Normal);

            //act
            var result = await _postService.GetPostsForBatchAsync(null, null);

            //assert
            Assert.Equal(result[0].Title, "OH");
            Assert.Equal(result[1].Title, "3");
            Assert.Equal(result[2].Title, "2");
            Assert.Equal(result[3].Title, "1");
        }