You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupAdditionalUsersFixtu...

37 lines
1005 B

using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Authentication;
using NzbDrone.Core.Housekeeping.Housekeepers;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
{
[TestFixture]
public class CleanupAdditionalUsersFixture : DbTest<CleanupAdditionalUsers, User>
{
[Test]
public void should_delete_additional_users()
{
var specs = Builder<User>.CreateListOfSize(5)
.BuildListOfNew();
Db.InsertMany(specs);
Subject.Clean();
AllStoredModels.Should().HaveCount(1);
}
[Test]
public void should_not_delete_if_only_one_user()
{
var spec = Builder<User>.CreateNew()
.BuildNew();
Db.Insert(spec);
Subject.Clean();
AllStoredModels.Should().HaveCount(1);
}
}
}