public void Put_ValidIdPassed_ReturnsOkObjectResult()
        {
            // Arrange
            var surveyDto = new SurveyDto
            {
                AuthorName  = "Updated Author",
                DateCreated = DateTime.Now,
                Description = "",
                Name        = "Updated Name",
                ViewCount   = 0
            };
            var id = 2;
            // Act
            var result = _controller.PutSurvey(id, surveyDto);

            // Assert
            Assert.IsType <OkResult>(result);
        }
        public async Task SetUp()
        {
            surveyController = new SurveyController();
            sqController     = new SurveyQuestionController();

            survey = new Survey("test survey");
            await surveyController.PutSurvey(survey);

            surveyQuestion = new SurveyQuestion(survey.SurveyId, 1, "test question");
        }
Beispiel #3
0
        public async Task Assert_put_survey()
        {
            IHttpActionResult result = await surveyController.PutSurvey(survey);

            Assert.IsInstanceOf(typeof(OkNegotiatedContentResult <Survey>), result);
        }