public void Registering_delegate_should_add_Confirmed_only_to_SupervisorDelegate_record_with_matching_id() { // Given const int matchingSupervisorDelegateId = 2; var supervisorDelegateIds = new List <int> { 1, 2, 3, 4, 5 }; var model = RegistrationModelTestHelper.GetDefaultDelegateRegistrationModel(); GivenPendingSupervisorDelegateIdsForEmailAre(supervisorDelegateIds); // When registrationService.RegisterDelegate( model, string.Empty, false, matchingSupervisorDelegateId ); // Then A.CallTo( () => supervisorDelegateService.ConfirmSupervisorDelegateRecord(matchingSupervisorDelegateId) ).MustHaveHappened(); A.CallTo( () => supervisorDelegateService.ConfirmSupervisorDelegateRecord( A <int> .That.Matches(id => id != matchingSupervisorDelegateId) ) ).MustNotHaveHappened(); }
public void AddConfirmedToSupervisorDelegateRecord_updates_record_with_correct_values_not_confirmed() { // Given var timeBeforeConfirmCalled = DateTime.UtcNow; // When supervisorDelegateService.ConfirmSupervisorDelegateRecord(2); // Then var timeAfterConfirmCalled = DateTime.UtcNow; A.CallTo( () => supervisorDelegateDataService.UpdateSupervisorDelegateRecordConfirmed( 2, A <DateTime> .That.Matches( dateTime => timeBeforeConfirmCalled < dateTime && dateTime < timeAfterConfirmCalled ) ) ).MustHaveHappened(); }