|
|
@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
var fakeEpisode = Builder<Episode>.CreateNew().With(c => c.SeriesId = 69).Build();
|
|
|
|
var fakeEpisode = Builder<Episode>.CreateNew().With(c => c.SeriesId = 69).Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
var repo = MockLib.GetEmptyRepository();
|
|
|
|
var repo = MockLib.GetEmptyRepository(true);
|
|
|
|
repo.Add(fakeSeries);
|
|
|
|
repo.Add(fakeSeries);
|
|
|
|
repo.Add(fakeEpisode);
|
|
|
|
repo.Add(fakeEpisode);
|
|
|
|
var fetchedSeries = repo.Single<Series>(fakeSeries.SeriesId);
|
|
|
|
var fetchedSeries = repo.Single<Series>(fakeSeries.SeriesId);
|
|
|
@ -42,32 +42,40 @@ namespace NzbDrone.Core.Test
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void ToString_test_over_castle_proxy()
|
|
|
|
[Ignore]
|
|
|
|
|
|
|
|
public void query_scratch_pad()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Arrange
|
|
|
|
|
|
|
|
var fakeSeries = Builder<Series>.CreateNew().With(s => s.SeriesId = 69).Build();
|
|
|
|
|
|
|
|
var fakeEpisode = Builder<Episode>.CreateNew().With(c => c.SeriesId = 69).Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
|
|
|
|
var repo = MockLib.GetEmptyRepository(true);
|
|
|
|
var repo = MockLib.GetEmptyRepository(true);
|
|
|
|
repo.Add(fakeSeries);
|
|
|
|
|
|
|
|
repo.Add(fakeEpisode);
|
|
|
|
repo.All<Episode>().Where(e => !e.Ignored && e.AirDate <= DateTime.Today && e.AirDate.Year > 1900).Select(
|
|
|
|
Console.WriteLine("Getting single");
|
|
|
|
s => s.Title).ToList();
|
|
|
|
var fetchedEpisode = repo.Single<Episode>(fakeEpisode.EpisodeId);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
|
|
[Ignore]
|
|
|
|
|
|
|
|
public void episode_proxy_to_string()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
var series = Builder<Series>.CreateNew()
|
|
|
|
|
|
|
|
.With(s => s.SeriesId = episode.SeriesId)
|
|
|
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var repo = MockLib.GetEmptyRepository(true);
|
|
|
|
|
|
|
|
repo.Add(episode);
|
|
|
|
|
|
|
|
repo.Add(series);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = repo.Single<Episode>(episode.EpisodeId).ToString();
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Console.WriteLine("Doing assert");
|
|
|
|
Console.WriteLine(result);
|
|
|
|
Assert.AreEqual(fakeEpisode.EpisodeId, fetchedEpisode.EpisodeId);
|
|
|
|
result.Should().Contain(series.Title);
|
|
|
|
Console.WriteLine("Doing assert");
|
|
|
|
result.Should().Contain(episode.EpisodeNumber.ToString());
|
|
|
|
Assert.AreEqual(fakeEpisode.Title, fetchedEpisode.Title);
|
|
|
|
result.Should().Contain(episode.SeasonNumber.ToString());
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("=======================");
|
|
|
|
|
|
|
|
var ttt = fetchedEpisode.Series;
|
|
|
|
|
|
|
|
Console.WriteLine("=======================");
|
|
|
|
|
|
|
|
var tttd = fetchedEpisode.Series;
|
|
|
|
|
|
|
|
Console.WriteLine("=======================");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Assert.Contains(fetchedEpisode.ToString(), fakeSeries.Title);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -78,7 +86,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
public void tvdbid_is_preserved()
|
|
|
|
public void tvdbid_is_preserved()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Arrange
|
|
|
|
//Arrange
|
|
|
|
var sonicRepo = MockLib.GetEmptyRepository();
|
|
|
|
var sonicRepo = MockLib.GetEmptyRepository(true);
|
|
|
|
var series = Builder<Series>.CreateNew().With(c => c.SeriesId = 18).Build();
|
|
|
|
var series = Builder<Series>.CreateNew().With(c => c.SeriesId = 18).Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
@ -105,7 +113,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
var message = Guid.NewGuid().ToString();
|
|
|
|
var message = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
var sonicRepo = MockLib.GetEmptyRepository();
|
|
|
|
var sonicRepo = MockLib.GetEmptyRepository(true);
|
|
|
|
|
|
|
|
|
|
|
|
var sonicTarget = new SubsonicTarget(sonicRepo);
|
|
|
|
var sonicTarget = new SubsonicTarget(sonicRepo);
|
|
|
|
|
|
|
|
|
|
|
@ -138,7 +146,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
var message = Guid.NewGuid().ToString();
|
|
|
|
var message = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
var sonicRepo = MockLib.GetEmptyRepository();
|
|
|
|
var sonicRepo = MockLib.GetEmptyRepository(true);
|
|
|
|
|
|
|
|
|
|
|
|
var sonicTarget = new SubsonicTarget(sonicRepo);
|
|
|
|
var sonicTarget = new SubsonicTarget(sonicRepo);
|
|
|
|
LogManager.Configuration.AddTarget("DbLogger", sonicTarget);
|
|
|
|
LogManager.Configuration.AddTarget("DbLogger", sonicTarget);
|
|
|
@ -171,7 +179,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
var message = String.Empty;
|
|
|
|
var message = String.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
var sonicRepo = MockLib.GetEmptyRepository();
|
|
|
|
var sonicRepo = MockLib.GetEmptyRepository(true);
|
|
|
|
|
|
|
|
|
|
|
|
var sonicTarget = new SubsonicTarget(sonicRepo);
|
|
|
|
var sonicTarget = new SubsonicTarget(sonicRepo);
|
|
|
|
LogManager.Configuration.AddTarget("DbLogger", sonicTarget);
|
|
|
|
LogManager.Configuration.AddTarget("DbLogger", sonicTarget);
|
|
|
|