예제 #1
0
        public async Task Assert_post_change_survey()
        {
            IHttpActionResult actionResult = await surveyController.PutSurvey(survey);

            var putResult = actionResult as OkNegotiatedContentResult <Survey>;

            Assert.IsNotNull(putResult);

            // Make changes to survey
            survey.SurveyTitle = "asd";
            survey.ClosingDate = DateTime.Now;
            await surveyController.PostSurveyChange(survey);

            IHttpActionResult newResult = await surveyController.GetSurveyById(survey.SurveyId);

            var    result    = newResult as OkNegotiatedContentResult <Survey>;
            Survey newSurvey = result.Content;

            Assert.AreEqual(survey, newSurvey);
        }