Exemple #1
0
        public void UpdateCustomPromptForCentre_calls_data_service()
        {
            // Given
            A.CallTo(() => centreCustomPromptsDataService.UpdateCustomPromptForCentre(1, 1, true, null)).DoesNothing();

            // When
            centreCustomPromptsService.UpdateCustomPromptForCentre(1, 1, true, null);

            // Then
            A.CallTo(() => centreCustomPromptsDataService.UpdateCustomPromptForCentre(1, 1, true, null))
            .MustHaveHappened();
        }
Exemple #2
0
        public void UpdateCustomPrompt_correctly_updates_custom_prompt()
        {
            using var transaction = new TransactionScope();
            try
            {
                // Given
                const string?options = "options";

                // When
                centreCustomPromptsDataService.UpdateCustomPromptForCentre(2, 1, false, options);
                var centreCustomPrompts = centreCustomPromptsDataService.GetCentreCustomPromptsByCentreId(2);

                // Then
                using (new AssertionScope())
                {
                    centreCustomPrompts.CustomField1Mandatory.Should().BeFalse();
                    centreCustomPrompts.CustomField1Options.Should().BeEquivalentTo(options);
                }
            }
            finally
            {
                transaction.Dispose();
            }
        }
Exemple #3
0
 public void UpdateCustomPromptForCentre(int centreId, int promptNumber, bool mandatory, string?options)
 {
     centreCustomPromptsDataService.UpdateCustomPromptForCentre(centreId, promptNumber, mandatory, options);
 }