private void GivenHistoryItem(string downloadId, string sourceTitle, QualityModel quality, EntityHistoryEventType eventType) { _history.Add(new EntityHistory { DownloadId = downloadId, SourceTitle = sourceTitle, Quality = quality, Date = DateTime.UtcNow, EventType = eventType }); }
private void GivenMostRecentForBook(int bookId, string downloadId, QualityModel quality, DateTime date, EntityHistoryEventType eventType) { Mocker.GetMock <IHistoryService>().Setup(s => s.MostRecentForBook(bookId)) .Returns(new EntityHistory { DownloadId = downloadId, Quality = quality, Date = date, EventType = eventType }); }
public List <EntityHistory> Find(string downloadId, EntityHistoryEventType eventType) { return(_historyRepository.FindByDownloadId(downloadId).Where(c => c.EventType == eventType).ToList()); }