public void Retrieve_GivenWorkflowStepByVersionAndQuestionOptionQuery_WorkflowStepShouldBeReturnedReturned()
        {
            var workflowVersionId = Guid.NewGuid();
            var questionOptionId  = Guid.NewGuid();
            var currentQuestionId = Guid.NewGuid();
            var alterQuestionId   = Guid.NewGuid();
            var nextQuestionId    = Guid.NewGuid();

            var set = new TestDbSet <WorkflowStep>
            {
                new WorkflowStep()
                {
                    WorkflowVersionId = workflowVersionId, QuestionOptionId = questionOptionId, CurrentWorkflowQuestionId = alterQuestionId
                },
                new WorkflowStep()
                {
                    WorkflowVersionId = workflowVersionId, QuestionOptionId = questionOptionId, CurrentWorkflowQuestionId = currentQuestionId, NextWorkflowQuestionId = nextQuestionId
                }
            };

            A.CallTo(() => _fakeContext.Set <WorkflowStep>()).Returns(set);

            var query = new WorkflowStepByVersionCurrentQuestionAndQuestionOptionQuery()
            {
                WorkflowVersionId = workflowVersionId, QuestionOptionId = questionOptionId, CurrentWorkflowQuestionId = currentQuestionId
            };

            var workflowStep = _queryHandler.Retrieve(query);

            workflowStep.Should().NotBeNull();
            workflowStep.NextWorkflowQuestionId.ShouldBeEquivalentTo(nextQuestionId);
        }
Exemplo n.º 2
0
        public void GivenIHaveAnsweredWith(Guid p0, Guid p1)
        {
            var queryHandler = ScenarioContext.Current.Get <WorkflowStepByVersionAndQuestionOptionQueryHandler>();

            var query = new WorkflowStepByVersionCurrentQuestionAndQuestionOptionQuery()
            {
                CurrentWorkflowQuestionId = p0,
                QuestionOptionId          = p1,
                WorkflowVersionId         = Guid.Parse("69C13E49-E05A-4185-B9B2-CCED15D99694")
            };

            ScenarioContext.Current.Set(queryHandler.Retrieve(query));
        }