GetPublishedSurveysAsync() public method

public GetPublishedSurveysAsync ( int pageIndex, int pageSize = Constants.DefaultPageSize ) : Task>
pageIndex int
pageSize int
return Task>
        public async Task GetPublishedSurveysAsync_Returns_CorrectSurveys()
        {
            // All contexts that share the same service provider will share the same InMemory database
            var options = CreateNewContextOptions();

            // Run the test against one instance of the context
            using (var context = new ApplicationDbContext(options))
            {
                context.AddRange(
                    new Survey { Id = 1, TenantId = 1 },
                    new Survey { Id = 2, TenantId = 1, Published = true },
                    new Survey { Id = 3, TenantId = 2 },
                    new Survey { Id = 4, TenantId = 2, Published = true }
                    );
                context.SaveChanges();
            }

            // Use a separate instance of the context to verify correct data was saved to database
            using (var context = new ApplicationDbContext(options))
            {
                var store = new SqlServerSurveyStore(context);
                var result = await store.GetPublishedSurveysAsync();

                Assert.Equal(2, result.Count);
                Assert.True(result.All(x => x.Published));
            }
        }