Sonarr/src/NzbDrone.Integration.Test/ApiTests/SeriesEditorFixture.cs

43 lines
1.1 KiB
C#
Raw Normal View History

2016-12-23 21:45:24 +00:00
using FluentAssertions;
2013-12-11 02:00:44 +00:00
using NUnit.Framework;
using System.Linq;
using NzbDrone.Test.Common;
namespace NzbDrone.Integration.Test.ApiTests
2013-12-11 02:00:44 +00:00
{
[TestFixture]
public class SeriesEditorFixture : IntegrationTest
2013-12-11 02:00:44 +00:00
{
private void GivenExistingSeries()
{
foreach (var title in new[] { "90210", "Dexter" })
{
var newSeries = Series.Lookup(title).First();
newSeries.ProfileId = 1;
2015-07-12 16:44:33 +00:00
newSeries.LanguageProfileId = 1;
newSeries.Path = string.Format(@"C:\Test\{0}", title).AsOsAgnostic();
2013-12-11 02:00:44 +00:00
Series.Post(newSeries);
}
}
[Test]
public void should_be_able_to_update_multiple_series()
{
GivenExistingSeries();
var series = Series.All();
foreach (var s in series)
{
s.ProfileId = 2;
2013-12-11 02:00:44 +00:00
}
var result = Series.Editor(series);
result.Should().HaveCount(2);
result.TrueForAll(s => s.ProfileId == 2).Should().BeTrue();
2013-12-11 02:00:44 +00:00
}
}
}