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.Integration.Test/ApiTests/ArtistEditorFixture.cs

48 lines
1.3 KiB

using System.Linq;
using FluentAssertions;
using Lidarr.Api.V1.Artist;
using NUnit.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Integration.Test.ApiTests
{
[TestFixture]
public class ArtistEditorFixture : IntegrationTest
{
private void GivenExistingArtist()
{
WaitForCompletion(() => QualityProfiles.All().Count > 0);
foreach (var name in new[] { "Alien Ant Farm", "Kiss" })
{
var newArtist = Artist.Lookup(name).First();
newArtist.QualityProfileId = 1;
newArtist.MetadataProfileId = 1;
newArtist.Path = string.Format(@"C:\Test\{0}", name).AsOsAgnostic();
Artist.Post(newArtist);
}
}
[Test]
public void should_be_able_to_update_multiple_artist()
{
GivenExistingArtist();
var artist = Artist.All();
var artistEditor = new ArtistEditorResource
{
QualityProfileId = 2,
ArtistIds = artist.Select(o => o.Id).ToList()
};
var result = Artist.Editor(artistEditor);
result.Should().HaveCount(2);
result.TrueForAll(s => s.QualityProfileId == 2).Should().BeTrue();
}
}
}