Esempio n. 1
0
        public async Task SurveyRunnerController_GetSurveyWithCookie_ReturnsSurvey()
        {
            var surveyName = "TestSurvey";
            await _fixture.SignInAsVolunteer(surveyName, "asdf,", "asdf", 1);

            var surveyManager = _fixture.ManagerFactory.CreateSurveyManager();
            await surveyManager.CreateSurvey(surveyName);


            var request = new HttpRequestMessage
            {
                Method     = HttpMethod.Get,
                RequestUri = new Uri($"SurveyRunner/GetSurvey?surveyId={surveyName}", UriKind.Relative),
            };

            var response = await _fixture.HttpClient.SendAsyncWithCookie(request, "VerifyLinkId");

            var content = await response.Content.ReadAsStringAsync();


            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Contains("{}", content);
        }