Beispiel #1
0
        public void Delete_AnonymousUser_Throw()
        {
            PortalRequest.Setup(p => p.IsAnonymousUser).Returns(true);
            var extension = Make_SelectionExtension();

            extension.Delete(null);
        }
        public void Set_GivenAnonymousUserAndSlideIsClosed_Throw()
        {
            PortalRequest.Setup(p => p.IsAnonymousUser).Returns(true);
            var extension = Make_AnswerExtension();
            var question  = new Question("TestQuestion")
            {
                Id = "00000000-0000-0000-0000-000000000001:0"
            };

            Context.QuestionnaireGateway.Set(new Questionnaire
            {
                Id           = "00000000-0000-0000-0000-000000000001",
                Name         = "Test",
                LockQuestion = true,
                Slides       = new List <Slide>
                {
                    new Slide
                    {
                        IsCompleted = true,
                        Questions   = new List <Question>
                        {
                            question
                        }
                    }
                }
            });

            extension.Set("00000000-0000-0000-0000-000000000001:0", null);
        }
Beispiel #3
0
        public void Get_GivenAnonymousUserAndSlideIsClosed_Throw()
        {
            PortalRequest.Setup(p => p.IsAnonymousUser).Returns(true);
            var extension     = Make_QuestionExtension();
            var questionnaire = Context.QuestionnaireGateway.Set(new Questionnaire
            {
                LockQuestion = true,
                Slides       = new[] { new Slide {
                                           IsCompleted = true, Questions = new[] { new Question("TestQuestion") }
                                       } }
            });

            extension.Get(questionnaire.Id);
        }
Beispiel #4
0
        public void Get_GivenKnownUserAndSlideIsClosed_ReturnFirstSlide()
        {
            PortalRequest.Setup(p => p.IsAnonymousUser).Returns(false);
            var extension     = Make_QuestionExtension();
            var questionnaire = Context.QuestionnaireGateway.Set(new Questionnaire
            {
                Slides = new[] { new Slide {
                                     IsCompleted = true, Questions = new[] { new Question("TestQuestion") }
                                 } }
            });

            var page = extension.Get(questionnaire.Id);

            Assert.That(page.Results, Is.Not.Empty);
        }