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/ThingiProvider/ProviderBaseFixture.cs

30 lines
965 B

using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Newznab;
11 years ago
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.ThingiProvider
{
public class ProviderRepositoryFixture : DbTest<IndexerRepository, IndexerDefinition>
11 years ago
{
[Test]
public void should_read_write_download_provider()
{
var model = Builder<IndexerDefinition>.CreateNew().BuildNew();
var newznabSettings = Builder<NewznabSettings>.CreateNew().Build();
model.Settings = newznabSettings;
Subject.Insert(model);
11 years ago
var storedProvider = Subject.Single();
11 years ago
storedProvider.Settings.Should().BeOfType<NewznabSettings>();
var storedSetting = (NewznabSettings)storedProvider.Settings;
storedSetting.ShouldBeEquivalentTo(newznabSettings, o=>o.IncludingAllRuntimeProperties());
11 years ago
}
}
}