Radarr/src/NzbDrone.Core.Test/Languages/LanguageProfileRepositoryFixture.cs
Qstick 3f064c94b9
New: Release Profiles, Frontend updates (#580)
* New: Release Profiles - UI Updates

* New: Release Profiles - API Changes

* New: Release Profiles - Test Updates

* New: Release Profiles - Backend Updates

* New: Interactive Artist Search

* New: Change Montiored on Album Details Page

* New: Show Duration on Album Details Page

* Fixed: Manual Import not working if no albums are Missing

* Fixed: Sort search input by sortTitle

* Fixed: Queue columnLabel throwing JS error
2019-02-23 17:39:11 -05:00

32 lines
No EOL
1 KiB
C#

using FluentAssertions;
using System.Linq;
using NUnit.Framework;
using NzbDrone.Core.Languages;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Profiles.Languages;
namespace NzbDrone.Core.Test.Languages
{
[TestFixture]
public class LanguageProfileRepositoryFixture : DbTest<LanguageProfileRepository, LanguageProfile>
{
[Test]
public void should_be_able_to_read_and_write()
{
var profile = new LanguageProfile
{
Languages = Language.All.OrderByDescending(l => l.Name).Select(l => new LanguageProfileItem {Language = l, Allowed = l == Language.English}).ToList(),
Name = "TestProfile",
Cutoff = Language.English
};
Subject.Insert(profile);
StoredModel.Name.Should().Be(profile.Name);
StoredModel.Cutoff.Should().Be(profile.Cutoff);
StoredModel.Languages.Should().Equal(profile.Languages, (a, b) => a.Language == b.Language && a.Allowed == b.Allowed);
}
}
}