added slug integration tests

pull/3113/head
Keivan Beigi 12 years ago
parent 8373e1ce10
commit 54d95e2e20

@ -46,6 +46,13 @@ namespace NzbDrone.Integration.Test.Client
return Post<TResource>(request); return Post<TResource>(request);
} }
public TResource Get(int id, HttpStatusCode statusCode = HttpStatusCode.OK)
{
var request = BuildRequest(id.ToString());
return Get<TResource>(request, statusCode);
}
public void Delete(int id) public void Delete(int id)
{ {
var request = BuildRequest(id.ToString()); var request = BuildRequest(id.ToString());

@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Net;
using NzbDrone.Api.Series; using NzbDrone.Api.Series;
using RestSharp; using RestSharp;
@ -18,5 +19,12 @@ namespace NzbDrone.Integration.Test.Client
return Get<List<SeriesResource>>(request); return Get<List<SeriesResource>>(request);
} }
public SeriesResource Get(string slug, HttpStatusCode statusCode = HttpStatusCode.OK)
{
var request = BuildRequest(slug);
return Get<SeriesResource>(request, statusCode);
}
} }
} }

@ -69,7 +69,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="Client\ClientBase.cs" /> <Compile Include="Client\ClientBase.cs" />
<Compile Include="Client\IndexerClient.cs" /> <Compile Include="Client\IndexerClient.cs" />
<Compile Include="Client\SeriesClient - Copy.cs" /> <Compile Include="Client\ReleaseClient.cs" />
<Compile Include="Client\SeriesClient.cs" /> <Compile Include="Client\SeriesClient.cs" />
<Compile Include="CommandIntegerationTests.cs" /> <Compile Include="CommandIntegerationTests.cs" />
<Compile Include="IndexerIntegrationFixture.cs" /> <Compile Include="IndexerIntegrationFixture.cs" />

@ -47,9 +47,20 @@ namespace NzbDrone.Integration.Test
Series.All().Should().HaveCount(1); Series.All().Should().HaveCount(1);
Series.Get(series.Id).Should().NotBeNull();
Series.Get(series.TitleSlug).Should().NotBeNull();
Series.Delete(series.Id); Series.Delete(series.Id);
Series.All().Should().BeEmpty(); Series.All().Should().BeEmpty();
} }
[Test]
public void wrong_slug_should_return_404()
{
Series.Get("non-existing-slug", HttpStatusCode.NotFound);
}
} }
} }
Loading…
Cancel
Save