mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
@@ -2,9 +2,9 @@ using System;
|
||||
using FluentAssertions;
|
||||
using FluentValidation.Results;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Notifications;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Validation;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
[TestFixture]
|
||||
public class NotificationBaseFixture : TestBase
|
||||
{
|
||||
class TestSetting : IProviderConfig
|
||||
private class TestSetting : IProviderConfig
|
||||
{
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
@@ -21,12 +21,11 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
}
|
||||
}
|
||||
|
||||
class TestNotificationWithOnReleaseImport : NotificationBase<TestSetting>
|
||||
private class TestNotificationWithOnReleaseImport : NotificationBase<TestSetting>
|
||||
{
|
||||
public override string Name => "TestNotification";
|
||||
public override string Link => "";
|
||||
|
||||
|
||||
public override ValidationResult Test()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -36,15 +35,13 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
{
|
||||
TestLogger.Info("OnDownload was called");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TestNotificationWithAllEvents : NotificationBase<TestSetting>
|
||||
private class TestNotificationWithAllEvents : NotificationBase<TestSetting>
|
||||
{
|
||||
public override string Name => "TestNotification";
|
||||
public override string Link => "";
|
||||
|
||||
|
||||
public override ValidationResult Test()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -86,18 +83,15 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
}
|
||||
}
|
||||
|
||||
class TestNotificationWithNoEvents : NotificationBase<TestSetting>
|
||||
private class TestNotificationWithNoEvents : NotificationBase<TestSetting>
|
||||
{
|
||||
public override string Name => "TestNotification";
|
||||
public override string Link => "";
|
||||
|
||||
|
||||
public override ValidationResult Test()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -127,7 +121,6 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
notification.SupportsOnTrackRetag.Should().BeTrue();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_support_none_if_none_are_implemented()
|
||||
{
|
||||
@@ -143,5 +136,4 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
notification.SupportsOnTrackRetag.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Notifications;
|
||||
using NzbDrone.Core.Notifications.Synology;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Test.Common;
|
||||
using System.IO;
|
||||
|
||||
namespace NzbDrone.Core.Test.NotificationTests
|
||||
{
|
||||
@@ -16,14 +16,14 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
{
|
||||
private Artist _artist;
|
||||
private AlbumDownloadMessage _upgrade;
|
||||
private string rootPath = @"C:\Test\".AsOsAgnostic();
|
||||
private string _rootPath = @"C:\Test\".AsOsAgnostic();
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
_artist = new Artist()
|
||||
{
|
||||
Path = rootPath,
|
||||
Path = _rootPath,
|
||||
};
|
||||
|
||||
_upgrade = new AlbumDownloadMessage()
|
||||
@@ -34,20 +34,19 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
{
|
||||
new TrackFile
|
||||
{
|
||||
Path = Path.Combine(rootPath, "file1.S01E01E02.mkv")
|
||||
Path = Path.Combine(_rootPath, "file1.S01E01E02.mkv")
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
OldFiles = new List<TrackFile>
|
||||
{
|
||||
new TrackFile
|
||||
{
|
||||
Path = Path.Combine(rootPath, "file1.S01E01.mkv")
|
||||
Path = Path.Combine(_rootPath, "file1.S01E01.mkv")
|
||||
},
|
||||
new TrackFile
|
||||
{
|
||||
Path = Path.Combine(rootPath, "file1.S01E02.mkv")
|
||||
Path = Path.Combine(_rootPath, "file1.S01E02.mkv")
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -56,7 +55,7 @@ namespace NzbDrone.Core.Test.NotificationTests
|
||||
{
|
||||
Settings = new SynologyIndexerSettings
|
||||
{
|
||||
UpdateLibrary = true
|
||||
UpdateLibrary = true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using System.Linq;
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Notifications.Xbmc;
|
||||
using NzbDrone.Core.Notifications.Xbmc.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
{
|
||||
@@ -26,9 +26,9 @@ namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
|
||||
_xbmcArtist = Builder<KodiArtist>.CreateListOfSize(3)
|
||||
.All()
|
||||
.With(s => s.MusicbrainzArtistId = new List<string>{"0"})
|
||||
.With(s => s.MusicbrainzArtistId = new List<string> { "0" })
|
||||
.TheFirst(1)
|
||||
.With(s => s.MusicbrainzArtistId = new List<string> {MB_ID.ToString()})
|
||||
.With(s => s.MusicbrainzArtistId = new List<string> { MB_ID.ToString() })
|
||||
.Build()
|
||||
.ToList();
|
||||
|
||||
@@ -41,9 +41,9 @@ namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
{
|
||||
_artist = new Artist
|
||||
{
|
||||
ForeignArtistId = MB_ID,
|
||||
Name = "Artist"
|
||||
};
|
||||
ForeignArtistId = MB_ID,
|
||||
Name = "Artist"
|
||||
};
|
||||
}
|
||||
|
||||
private void GivenMatchingTitle()
|
||||
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
{
|
||||
ForeignArtistId = "1000",
|
||||
Name = "Does not exist"
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -4,10 +4,10 @@ using FizzWare.NBuilder;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Notifications;
|
||||
using NzbDrone.Core.Notifications.Xbmc;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
{
|
||||
@@ -15,7 +15,7 @@ namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
public class OnReleaseImportFixture : CoreTest<Notifications.Xbmc.Xbmc>
|
||||
{
|
||||
private AlbumDownloadMessage _albumDownloadMessage;
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
@@ -33,9 +33,9 @@ namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
|
||||
Subject.Definition = new NotificationDefinition();
|
||||
Subject.Definition.Settings = new XbmcSettings
|
||||
{
|
||||
UpdateLibrary = true
|
||||
};
|
||||
{
|
||||
UpdateLibrary = true
|
||||
};
|
||||
}
|
||||
|
||||
private void GivenOldFiles()
|
||||
@@ -45,10 +45,10 @@ namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
.ToList();
|
||||
|
||||
Subject.Definition.Settings = new XbmcSettings
|
||||
{
|
||||
UpdateLibrary = true,
|
||||
CleanLibrary = true
|
||||
};
|
||||
{
|
||||
UpdateLibrary = true,
|
||||
CleanLibrary = true
|
||||
};
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -3,10 +3,10 @@ using System.Linq;
|
||||
using FizzWare.NBuilder;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Notifications.Xbmc;
|
||||
using NzbDrone.Core.Notifications.Xbmc.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
{
|
||||
@@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
|
||||
_xbmcArtist = Builder<KodiArtist>.CreateListOfSize(3)
|
||||
.TheFirst(1)
|
||||
.With(s => s.MusicbrainzArtistId = new List<string> { MB_ID.ToString()})
|
||||
.With(s => s.MusicbrainzArtistId = new List<string> { MB_ID.ToString() })
|
||||
.TheNext(2)
|
||||
.With(s => s.MusicbrainzArtistId = new List<string>())
|
||||
.Build()
|
||||
@@ -61,10 +61,10 @@ namespace NzbDrone.Core.Test.NotificationTests.Xbmc
|
||||
.With(s => s.Name = "Not Shawn Desman")
|
||||
.Build();
|
||||
|
||||
Subject.Update(_settings, fakeArtist);
|
||||
Subject.Update(_settings, fakeArtist);
|
||||
|
||||
Mocker.GetMock<IXbmcJsonApiProxy>()
|
||||
.Verify(v => v.UpdateLibrary(_settings, null), Times.Once());
|
||||
Mocker.GetMock<IXbmcJsonApiProxy>()
|
||||
.Verify(v => v.UpdateLibrary(_settings, null), Times.Once());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user