public void ThenTheJobShouldBeAddedToTheSystemWithTheDetailsProvided() { _uiViewInfo.Should().NotBeNull(); JobInfo matchingJob = null; Poller.PollForSuccess(() => { JobInfo[] storedJobs = _jobRepository.GetByRegistration(_uiViewInfo.Registration); matchingJob = storedJobs.SingleOrDefault(j => j.Registration == _uiViewInfo.Registration && j.Description == _uiViewInfo.Description && j.Date == _uiViewInfo.Date && j.Hours == _uiViewInfo.Hours && j.Mileage == _uiViewInfo.Mileage); return(matchingJob != null); }); matchingJob.Should().NotBeNull(); }