Beispiel #1
0
            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssueReactionsClient(connection);

                await client.GetAll(1, 42);

                connection.Received().GetAll <Reaction>(Arg.Is <Uri>(u => u.ToString() == "repositories/1/issues/42/reactions"), null, "application/vnd.github.squirrel-girl-preview", Args.ApiOptions);
            }
Beispiel #2
0
            public async Task RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssueReactionsClient(connection);

                await client.GetAll("fake", "repo", 42);

                connection.Received().GetAll <Reaction>(Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/issues/42/reactions"), "application/vnd.github.squirrel-girl-preview");
            }
            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssueReactionsClient(connection);

                await client.GetAll(1, 42);

                connection.Received().GetAll<Reaction>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42/reactions"), "application/vnd.github.squirrel-girl-preview");
            }
Beispiel #4
0
            public async Task RequestsCorrectUrlApiOptions()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new IssueReactionsClient(connection);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    StartPage = 1,
                    PageSize  = 1
                };

                await client.GetAll("fake", "repo", 42, options);

                connection.Received().GetAll <Reaction>(Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/issues/42/reactions"), null, "application/vnd.github.squirrel-girl-preview", options);
            }