Don't fail test if there are no builds with changes shown

pull/2/head
Qstick 4 years ago
parent bd5bb2a63c
commit 5eb7a83996

@ -46,13 +46,19 @@ namespace NzbDrone.Core.Test.UpdateTests
const string branch = "develop";
UseRealHttp();
var recent = Subject.GetRecentUpdates(branch, new Version(2, 0));
var recentWithChanges = recent.Where(c => c.Changes != null);
recent.Should().NotBeEmpty();
recent.Should().OnlyContain(c => c.Hash.IsNotNullOrWhiteSpace());
recent.Should().OnlyContain(c => c.FileName.Contains("Radarr"));
recent.Should().OnlyContain(c => c.ReleaseDate.Year >= 2014);
recent.Where(c => c.Changes != null).Should().OnlyContain(c => c.Changes.New != null);
recent.Where(c => c.Changes != null).Should().OnlyContain(c => c.Changes.Fixed != null);
if (recentWithChanges.Any())
{
recentWithChanges.Should().OnlyContain(c => c.Changes.New != null);
recentWithChanges.Should().OnlyContain(c => c.Changes.Fixed != null);
}
recent.Should().OnlyContain(c => c.Branch == branch);
}
}

Loading…
Cancel
Save