Cardigann Auth first pass

This commit is contained in:
Qstick
2021-02-09 00:13:47 -05:00
parent cd65729239
commit a41ae141cd
25 changed files with 793 additions and 72 deletions

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Net;
using FluentAssertions;
using Moq;
using NUnit.Framework;
@@ -36,11 +37,11 @@ namespace NzbDrone.Core.Test.IndexerTests.PTPTests
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.POST)))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), authStream.ToString()));
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), new CookieCollection(), authStream.ToString()));
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader { ContentType = HttpAccept.Json.Value }, responseJson));
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader { ContentType = HttpAccept.Json.Value }, new CookieCollection(), responseJson));
var torrents = Subject.Fetch(new MovieSearchCriteria()).Releases;