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

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

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

                client.GetAllUserReceivedPublic("fake");

                gitHubClient.Connection.Received(1).Get <List <Activity> >(new Uri("users/fake/received_events/public", UriKind.Relative), Args.EmptyDictionary, null);
            }
Example #3
0
            public async Task ReturnsUserReceivedPublicEvents()
            {
                var userReceivedPublicEvents = await _eventsClient.GetAllUserReceivedPublic(user).ToList();

                Assert.NotEmpty(userReceivedPublicEvents);
            }