Exemplo n.º 1
0
        public void WhenQuestionAnswered_ShouldAnswerResponseBeValid()
        {
            QuestionHelper questionHelper = new QuestionHelper(AppHost.Container);

            string userId = Guid.NewGuid().ToString();

            CreateInMemoryUser(userId);
            SetSession(new CustomUserSession()
            {
                UserId = userId
            });

            AskQuestionResponse askQuestionResponse = questionHelper.AskQuestion();

            askQuestionResponse.PrintDump();
            Assert.IsNotNull(askQuestionResponse.QuestionId, "Question should be created. QuestionId cannot be null.");

            var answerResponse = questionHelper.AnswerQuestion(askQuestionResponse.QuestionId);
            answerResponse.PrintDump();
            Assert.IsNotNull(answerResponse.AnswerId, "Answer should be created. AnswerId cannot be null.");

            var removeResponse = questionHelper.RemoveAnswer(answerResponse.AnswerId);
        }