GetSurveyAsync() public method

public GetSurveyAsync ( int id ) : Task
id int
return Task
        public async Task GetSurveyAsync_Returns_Survey_Contributors()
        {
            // 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))
            {
                var survey = new Survey
                {
                    Id = 1,
                    Contributors = new List<SurveyContributor>
                    {
                        new SurveyContributor { SurveyId = 1, UserId = 2 }
                    }
                };
                context.Add(survey);
                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.GetSurveyAsync(1);

                Assert.NotNull(result.Contributors);
                Assert.NotEmpty(result.Contributors);
            }
        }
        public async Task GetSurveyAsync_Returns_CorrectSurvey()
        {
            // All contexts that share the same service provider will share the same InMemory database
            var options = CreateNewContextOptions();

            using (var context = new ApplicationDbContext(options))
            {
                context.Add(new Survey { Id = 1 });
                context.SaveChanges();
            }

            using (var context = new ApplicationDbContext(options))
            {
                var store = new SqlServerSurveyStore(context);
                var result = await store.GetSurveyAsync(1);
                Assert.Equal(1, result.Id);
            }
        }