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

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

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

                client.GetAllUserPerformedPublic("fake");

                gitHubClient.Connection.Received(1).Get <List <Activity> >(new Uri("users/fake/events/public", UriKind.Relative), Args.EmptyDictionary, null);
            }
Exemple #3
0
            public async Task ReturnsUserPerformedPublicEvents()
            {
                var userPerformedPublicEvents = await _eventsClient.GetAllUserPerformedPublic(user).ToList();

                Assert.NotEmpty(userPerformedPublicEvents);
            }