Fixed: Fix some api integration tests

pull/481/head
Qstick 6 years ago
parent 2a992f6c2b
commit aab70b512d

@ -17,6 +17,7 @@ namespace NzbDrone.Integration.Test.ApiTests
newArtist.QualityProfileId = 1;
newArtist.LanguageProfileId = 1;
newArtist.MetadataProfileId = 1;
newArtist.Path = string.Format(@"C:\Test\{0}", name).AsOsAgnostic();
Artist.Post(newArtist);

@ -19,6 +19,7 @@ namespace NzbDrone.Integration.Test.ApiTests
artist.QualityProfileId = 1;
artist.LanguageProfileId = 1;
artist.MetadataProfileId = 1;
artist.Path = Path.Combine(ArtistRootFolder, artist.ArtistName);
artist.Tags = new HashSet<int>();
artist.Tags.Add(tag.Id);
@ -63,6 +64,7 @@ namespace NzbDrone.Integration.Test.ApiTests
artist.QualityProfileId = 1;
artist.LanguageProfileId = 1;
artist.MetadataProfileId = 1;
artist.Path = Path.Combine(ArtistRootFolder, artist.ArtistName);
var result = Artist.Post(artist);
@ -71,6 +73,7 @@ namespace NzbDrone.Integration.Test.ApiTests
result.Id.Should().NotBe(0);
result.QualityProfileId.Should().Be(1);
result.LanguageProfileId.Should().Be(1);
result.MetadataProfileId.Should().Be(1);
result.Path.Should().Be(Path.Combine(ArtistRootFolder, artist.ArtistName));
}

@ -1,4 +1,4 @@
using FluentAssertions;
using FluentAssertions;
using NUnit.Framework;
using System.Linq;
using NzbDrone.Integration.Test.Client;
@ -104,7 +104,7 @@ namespace NzbDrone.Integration.Test.ApiTests
public void get_all_mediafiles()
{
var tempDir = GetTempDirectory("mediaDir");
File.WriteAllText(Path.Combine(tempDir, "somevideo.mkv"), "video");
File.WriteAllText(Path.Combine(tempDir, "somevideo.mp3"), "audio");
var request = FileSystem.BuildRequest("mediafiles");
request.Method = Method.GET;
@ -117,7 +117,7 @@ namespace NzbDrone.Integration.Test.ApiTests
result.First().Should().ContainKey("relativePath");
result.First().Should().ContainKey("name");
result.First()["name"].Should().Be("somevideo.mkv");
result.First()["name"].Should().Be("somevideo.mp3");
}
}
}

@ -1,4 +1,4 @@
using FluentAssertions;
using FluentAssertions;
using NUnit.Framework;
namespace NzbDrone.Integration.Test.ApiTests
@ -26,7 +26,7 @@ namespace NzbDrone.Integration.Test.ApiTests
{
var config = NamingConfig.GetSingle();
config.RenameTracks = false;
config.StandardTrackFormat = "{Artist Name} - {track:00} - {Album Title}";
config.StandardTrackFormat = "{Artist Name} - {Album Title} - {track:00} - {Track Title}";
var result = NamingConfig.Put(config);
result.RenameTracks.Should().BeFalse();
@ -89,4 +89,4 @@ namespace NzbDrone.Integration.Test.ApiTests
errors.Should().NotBeNull();
}
}
}
}

@ -1,7 +1,6 @@
using FluentAssertions;
using NUnit.Framework;
using Lidarr.Api.V1.Indexers;
using System.Linq;
using System.Net;
using System.Collections.Generic;
using System;
@ -17,7 +16,7 @@ namespace NzbDrone.Integration.Test.ApiTests
{
var body = new Dictionary<string, object>();
body.Add("guid", "sdfsdfsdf");
body.Add("title", "The Artist - The Album");
body.Add("title", "The Artist - The Album (2008) [FLAC]");
body.Add("publishDate", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ssZ", CultureInfo.InvariantCulture));
var request = ReleasePush.BuildRequest();

Loading…
Cancel
Save