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(); }
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(); } }
public void UpdateCustomPromptForCentre(int centreId, int promptNumber, bool mandatory, string?options) { centreCustomPromptsDataService.UpdateCustomPromptForCentre(centreId, promptNumber, mandatory, options); }