Beispiel #1
0
        internal static TraktClient GetMockClient(string uri, HttpStatusCode httpStatusCode)
        {
            var httpClientProvider = new TestHttpClientProvider(Constants.API_URL);

            httpClientProvider.SetupMockResponse(uri, httpStatusCode);
            return(new TraktClient(TestConstants.TRAKT_CLIENT_ID, TestConstants.TRAKT_CLIENT_SECRET, httpClientProvider));
        }
Beispiel #2
0
        internal static TraktClient GetAuthenticationMockClient(string uri, string requestContent, string responseContent)
        {
            var httpClientProvider = new TestHttpClientProvider(Constants.API_URL);

            httpClientProvider.SetupAuthenticationMockResponse(uri, requestContent, responseContent);
            return(new TraktClient(TestConstants.TRAKT_CLIENT_ID, TestConstants.TRAKT_CLIENT_SECRET, httpClientProvider));
        }
Beispiel #3
0
        internal static TraktClient GetOAuthMockClient(string uri, HttpStatusCode httpStatusCode)
        {
            var httpClientProvider = new TestHttpClientProvider(Constants.API_URL);

            httpClientProvider.SetupOAuthMockResponse(uri, httpStatusCode);
            return(new TraktClient(TestConstants.TRAKT_CLIENT_ID, TestConstants.TRAKT_CLIENT_SECRET, httpClientProvider)
            {
                Authorization = TestConstants.MOCK_AUTHORIZATION
            });
        }
Beispiel #4
0
        internal static TraktClient GetMockClient(string uri, string responseContent,
                                                  uint?page      = null, uint?limit       = null,
                                                  int?pageCount  = null, int?itemCount    = null,
                                                  int?userCount  = null, string startDate = null,
                                                  string endDate = null, string sortBy    = null,
                                                  string sortHow = null)
        {
            var httpClientProvider = new TestHttpClientProvider(Constants.API_URL);

            httpClientProvider.SetupMockResponse(uri, responseContent, page, limit, pageCount, itemCount, userCount, startDate, endDate, sortBy, sortHow);
            return(new TraktClient(TestConstants.TRAKT_CLIENT_ID, TestConstants.TRAKT_CLIENT_SECRET, httpClientProvider));
        }
Beispiel #5
0
        internal static TraktClient GetAuthenticationMockClient()
        {
            var httpClientProvider = new TestHttpClientProvider(Constants.API_URL);

            return(new TraktClient(TestConstants.TRAKT_CLIENT_ID, TestConstants.TRAKT_CLIENT_SECRET, httpClientProvider));
        }
Beispiel #6
0
 internal static void VerifyNoOutstandingExpectations(TestHttpClientProvider httpClientProvider)
 {
     httpClientProvider.VerifyNoOutstandingExpectations();
 }
Beispiel #7
0
 internal static void AddMockExpectationResponse(TestHttpClientProvider httpClientProvider, string uri, HttpStatusCode httpStatusCode)
 {
     httpClientProvider.AddExpectationMockResponse(uri, httpStatusCode);
 }
Beispiel #8
0
 internal static void AddMockExpectationResponse(TestHttpClientProvider httpClientProvider, string uri, string requestContent, string responseContent)
 {
     httpClientProvider.AddExpectationMockResponse(uri, requestContent, responseContent);
 }
Beispiel #9
0
 internal static void ChangeAuthenticationMockResponse(TestHttpClientProvider httpClientProvider, string uri, string requestContent, string responseContent, HttpStatusCode httpStatusCode)
 {
     httpClientProvider.ChangeAuthenticationMockResponse(uri, requestContent, responseContent, httpStatusCode);
 }