mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
@@ -44,7 +44,7 @@ namespace NzbDrone.Core.Test.Profiles.Delay
|
||||
var moving = _last;
|
||||
var result = Subject.Reorder(moving.Id, null).OrderBy(d => d.Order).ToList();
|
||||
var moved = result.First();
|
||||
|
||||
|
||||
moved.Id.Should().Be(moving.Id);
|
||||
moved.Order.Should().Be(1);
|
||||
}
|
||||
@@ -75,7 +75,6 @@ namespace NzbDrone.Core.Test.Profiles.Delay
|
||||
{
|
||||
delayProfile.Order.Should().Be(int.MaxValue);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
delayProfile.Order.Should().Be(i + 1);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using FluentAssertions;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Profiles.Metadata;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.Profiles.Metadata
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FizzWare.NBuilder;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.ImportLists;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Profiles.Metadata;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.Profiles.Metadata
|
||||
{
|
||||
@@ -26,6 +26,7 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
//This confirms that new profiles are added only if no other profiles exists.
|
||||
//We don't want to keep adding them back if a user deleted them on purpose.
|
||||
public void Init_should_skip_if_any_profiles_already_exist()
|
||||
@@ -128,7 +129,6 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
|
||||
Assert.Throws<MetadataProfileInUseException>(() => Subject.Delete(profile.Id));
|
||||
|
||||
Mocker.GetMock<IMetadataProfileRepository>().Verify(c => c.Delete(It.IsAny<int>()), Times.Never());
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -155,7 +155,6 @@ namespace NzbDrone.Core.Test.Profiles.Metadata
|
||||
Assert.Throws<MetadataProfileInUseException>(() => Subject.Delete(profile.Id));
|
||||
|
||||
Mocker.GetMock<IMetadataProfileRepository>().Verify(c => c.Delete(It.IsAny<int>()), Times.Never());
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -13,11 +13,11 @@ namespace NzbDrone.Core.Test.Profiles
|
||||
public void should_be_able_to_read_and_write()
|
||||
{
|
||||
var profile = new QualityProfile
|
||||
{
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_192, Quality.MP3_256),
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Name = "TestProfile"
|
||||
};
|
||||
{
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_192, Quality.MP3_256),
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Name = "TestProfile"
|
||||
};
|
||||
|
||||
Subject.Insert(profile);
|
||||
|
||||
@@ -25,8 +25,6 @@ namespace NzbDrone.Core.Test.Profiles
|
||||
StoredModel.Cutoff.Should().Be(profile.Cutoff);
|
||||
|
||||
StoredModel.Items.Should().Equal(profile.Items, (a, b) => a.Quality == b.Quality && a.Allowed == b.Allowed);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.ImportLists;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Profiles.Qualities;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Test.Profiles
|
||||
{
|
||||
@@ -24,6 +24,7 @@ namespace NzbDrone.Core.Test.Profiles
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
//This confirms that new profiles are added only if no other profiles exists.
|
||||
//We don't want to keep adding them back if a user deleted them on purpose.
|
||||
public void Init_should_skip_if_any_profiles_already_exist()
|
||||
@@ -38,7 +39,6 @@ namespace NzbDrone.Core.Test.Profiles
|
||||
.Verify(v => v.Insert(It.IsAny<QualityProfile>()), Times.Never());
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void should_not_be_able_to_delete_profile_if_assigned_to_artist()
|
||||
{
|
||||
@@ -63,7 +63,6 @@ namespace NzbDrone.Core.Test.Profiles
|
||||
Assert.Throws<QualityProfileInUseException>(() => Subject.Delete(profile.Id));
|
||||
|
||||
Mocker.GetMock<IProfileRepository>().Verify(c => c.Delete(It.IsAny<int>()), Times.Never());
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -90,7 +89,6 @@ namespace NzbDrone.Core.Test.Profiles
|
||||
Assert.Throws<QualityProfileInUseException>(() => Subject.Delete(profile.Id));
|
||||
|
||||
Mocker.GetMock<IProfileRepository>().Verify(c => c.Delete(It.IsAny<int>()), Times.Never());
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Profiles.Qualities;
|
||||
|
||||
@@ -4,9 +4,9 @@ using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Profiles.Releases;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Test.Profiles.Releases.PreferredWordService
|
||||
{
|
||||
@@ -21,26 +21,25 @@ namespace NzbDrone.Core.Test.Profiles.Releases.PreferredWordService
|
||||
public void Setup()
|
||||
{
|
||||
_artist = Builder<Artist>.CreateNew()
|
||||
.With(s => s.Tags = new HashSet<int>(new[] {1, 2}))
|
||||
.With(s => s.Tags = new HashSet<int>(new[] { 1, 2 }))
|
||||
.Build();
|
||||
|
||||
_releaseProfiles = new List<ReleaseProfile>();
|
||||
|
||||
_releaseProfiles.Add(new ReleaseProfile
|
||||
{
|
||||
Preferred = new List<KeyValuePair<string, int>>
|
||||
{
|
||||
Preferred = new List<KeyValuePair<string, int>>
|
||||
{
|
||||
new KeyValuePair<string, int>("24bit", 5),
|
||||
new KeyValuePair<string, int>("16bit", -10)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Mocker.GetMock<IReleaseProfileService>()
|
||||
.Setup(s => s.AllForTags(It.IsAny<HashSet<int>>()))
|
||||
.Returns(_releaseProfiles);
|
||||
}
|
||||
|
||||
|
||||
private void GivenMatchingTerms(params string[] terms)
|
||||
{
|
||||
Mocker.GetMock<ITermMatcherService>()
|
||||
|
||||
+1
-3
@@ -4,9 +4,9 @@ using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Profiles.Releases;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Test.Profiles.Releases.PreferredWordService
|
||||
{
|
||||
@@ -35,13 +35,11 @@ namespace NzbDrone.Core.Test.Profiles.Releases.PreferredWordService
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Mocker.GetMock<ITermMatcherService>()
|
||||
.Setup(s => s.MatchingTerm(It.IsAny<string>(), _title))
|
||||
.Returns<string, string>((term, title) => title.Contains(term) ? term : null);
|
||||
}
|
||||
|
||||
|
||||
private void GivenReleaseProfile()
|
||||
{
|
||||
Mocker.GetMock<IReleaseProfileService>()
|
||||
|
||||
Reference in New Issue
Block a user