mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
Episode is now marked as grabbed on download
This commit is contained in:
parent
f2b091dcd2
commit
c37544d4ce
8 changed files with 43 additions and 5 deletions
|
@ -757,6 +757,31 @@ namespace NzbDrone.Core.Test
|
|||
episode.EpisodeFile.Should().BeNull();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MarkEpisodeAsFetched()
|
||||
{
|
||||
var mocker = new AutoMoqer();
|
||||
var db = MockLib.GetEmptyDatabase();
|
||||
mocker.SetConstant(db);
|
||||
|
||||
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
||||
.WhereAll().Have(e => e.GrabDate = null)
|
||||
.Build();
|
||||
|
||||
db.InsertMany(fakeEpisodes);
|
||||
|
||||
//Act
|
||||
mocker.Resolve<EpisodeProvider>().MarkEpisodeAsFetched(2);
|
||||
var episodes = db.Fetch<Episode>();
|
||||
|
||||
//Assert
|
||||
episodes.Where(e => e.EpisodeId == 2).Single().GrabDate.Should().BeWithin(TimeSpan.FromSeconds(5)).Before(
|
||||
DateTime.Now);
|
||||
|
||||
episodes.Where(e => e.GrabDate == null).Should().HaveCount(4);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue