mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-25 11:13:39 +02:00
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using FizzWare.NBuilder;
|
|
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Core.Housekeeping.Housekeepers;
|
|
using NzbDrone.Core.Organizer;
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
|
|
{
|
|
[TestFixture]
|
|
public class CleanupAdditionalNamingSpecsFixture : DbTest<CleanupAdditionalNamingSpecs, NamingConfig>
|
|
{
|
|
[Test]
|
|
public void should_delete_additional_naming_configs()
|
|
{
|
|
var specs = Builder<NamingConfig>.CreateListOfSize(5)
|
|
.BuildListOfNew();
|
|
|
|
Db.InsertMany(specs);
|
|
|
|
Subject.Clean();
|
|
AllStoredModels.Should().HaveCount(1);
|
|
}
|
|
|
|
[Test]
|
|
public void should_not_delete_if_only_one_spec()
|
|
{
|
|
var spec = Builder<NamingConfig>.CreateNew()
|
|
.BuildNew();
|
|
|
|
Db.Insert(spec);
|
|
|
|
Subject.Clean();
|
|
AllStoredModels.Should().HaveCount(1);
|
|
}
|
|
}
|
|
} |