コード例 #1
0
        public void GetCustomPromptsForCentreByCentreId_Returns_Populated_CentreCustomPrompts()
        {
            // Given
            var expectedPrompt1 = CustomPromptsTestHelper.GetDefaultCustomPrompt(1, options: null, mandatory: true);
            var expectedPrompt2 = CustomPromptsTestHelper.GetDefaultCustomPrompt(2, "Department / team", null, true);
            var customPrompts   = new List <CustomPrompt> {
                expectedPrompt1, expectedPrompt2
            };
            var expectedCustomerPrompts = CustomPromptsTestHelper.GetDefaultCentreCustomPrompts(customPrompts);

            A.CallTo(() => centreCustomPromptsDataService.GetCentreCustomPromptsByCentreId(29))
            .Returns
            (
                CustomPromptsTestHelper.GetDefaultCentreCustomPromptsResult(
                    customField1Prompt: "Custom Prompt",
                    customField1Options: null
                    )
            );

            // When
            var result = centreCustomPromptsService.GetCustomPromptsForCentreByCentreId(29);

            // Then
            result.Should().BeEquivalentTo(expectedCustomerPrompts);
        }
コード例 #2
0
        public CentreCustomPrompts GetCustomPromptsForCentreByCentreId(int centreId)
        {
            var result = centreCustomPromptsDataService.GetCentreCustomPromptsByCentreId(centreId);

            return(new CentreCustomPrompts(
                       result.CentreId,
                       PopulateCustomPromptListFromCentreCustomPromptsResult(result)
                       ));
        }
コード例 #3
0
        public void GetCentreCustomPromptsByCentreId_Returns_populated_CentreCustomPromptsResult()
        {
            // Given
            var expectedCentreCustomPromptsResult = CustomPromptsTestHelper.GetDefaultCentreCustomPromptsResult();

            // When
            var returnedCentreCustomPromptsResult = centreCustomPromptsDataService.GetCentreCustomPromptsByCentreId(29);

            // Then
            returnedCentreCustomPromptsResult.Should().BeEquivalentTo(expectedCentreCustomPromptsResult);
        }