2013-09-21 06:39:26 +00:00
|
|
|
|
using FizzWare.NBuilder;
|
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using NzbDrone.Core.Notifications;
|
|
|
|
|
using NzbDrone.Core.Notifications.Email;
|
2013-09-21 00:18:11 +00:00
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
using NzbDrone.Core.ThingiProvider;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.ThingiProvider
|
|
|
|
|
{
|
|
|
|
|
|
2013-09-21 06:39:26 +00:00
|
|
|
|
public class ProviderRepositoryFixture : DbTest<NotificationProviderRepository, NotificationProviderModel>
|
2013-09-21 00:18:11 +00:00
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_read_write_download_provider()
|
|
|
|
|
{
|
2013-09-21 06:39:26 +00:00
|
|
|
|
var model = Builder<NotificationProviderModel>.CreateNew().BuildNew();
|
|
|
|
|
var emailSettings = Builder<EmailSettings>.CreateNew().Build();
|
|
|
|
|
model.Settings = emailSettings;
|
|
|
|
|
Subject.Insert(model);
|
2013-09-21 00:18:11 +00:00
|
|
|
|
|
2013-09-21 06:39:26 +00:00
|
|
|
|
var storedProvider = Subject.Single();
|
|
|
|
|
|
|
|
|
|
storedProvider.Settings.Should().BeOfType<EmailSettings>();
|
2013-09-21 00:18:11 +00:00
|
|
|
|
|
2013-09-21 06:39:26 +00:00
|
|
|
|
var storedSetting = (EmailSettings) storedProvider.Settings;
|
|
|
|
|
|
|
|
|
|
storedSetting.ShouldHave().AllProperties().EqualTo(emailSettings);
|
2013-09-21 00:18:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|