Esempio n. 1
0
            public async Task EnsuresArgumentsNotNull()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableEventsClient(gitHubClient);

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllForOrganization(null).ToTask());

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetAllForOrganization("").ToTask());
            }
Esempio n. 2
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableEventsClient(gitHubClient);

                client.GetAllForOrganization("fake");

                gitHubClient.Connection.Received(1).Get <List <Activity> >(new Uri("orgs/fake/events", UriKind.Relative), Args.EmptyDictionary, null);
            }
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableEventsClient(gitHubClient);

                client.GetAllForOrganization("fake");

                gitHubClient.Connection.GetAsync <IReadOnlyList <Activity> >(new Uri("orgs/fake/events", UriKind.Relative), null, null);
            }
Esempio n. 4
0
            public async Task ReturnsOrganizationEvents()
            {
                var organizationEvents = await _eventsClient.GetAllForOrganization(organization).ToList();

                Assert.NotEmpty(organizationEvents);
            }