private void AddResponseToResults(string thirdPartyId, SchedulingResponse response) { if (Results.ContainsKey(thirdPartyId) == false) { Results.Add(thirdPartyId, response); } }
private void ProcessMeetingsIntoResults(List <Conference> meetings) { foreach (Conference meeting in meetings) { SchedulingResponse response = this._api.ProcessMeeting(meeting); AddResponseToResults(meeting.ThirdPartyConferenceId, response); } }
public void ThenTheAgentShouldHaveAConfirmationNumberForEachMeetingWithoutAConflict() { foreach (Conference meeting in _importer.Meetings) { if (_agentProcessingResponse.ContainsKey(meeting.ThirdPartyConferenceId)) { SchedulingResponse response = _agentProcessingResponse[meeting.ThirdPartyConferenceId]; bool shouldBeConflict = (response.ConfirmationNumber == 0); Assert.AreEqual(response.IsError, shouldBeConflict); } } }
public SchedulingResponse SaveConference(Conference conference) { SchedulingResponse response = new SchedulingResponse(); response.ConfirmationNumber = conference.ConfirmationNumber; if (response.ConfirmationNumber == 0) { response.ConfirmationNumber = 100; } response.Error = string.Empty; return(response); }
public SchedulingResponse ProcessMeeting(Conference conference) { SchedulingResponse response; if (conference.Status == ScheduleStatus.Cancelled || conference.Status == ScheduleStatus.Deleted) { response = new SchedulingResponse(); response.IsError = _repository.SetConferenceStatus(conference.ConfirmationNumber, conference.Status); response.Error = (response.IsError) ? "Failed to modify the meeting status to " + conference.Status.ToString() : string.Empty; } else { response = _repository.SaveConference(conference); } return(response); }