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

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

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

                client.GetAllUserReceived("fake");

                gitHubClient.Connection.Received(1).Get <List <Activity> >(new Uri("users/fake/received_events", UriKind.Relative), Args.EmptyDictionary, null);
            }
Ejemplo n.º 3
0
            public async Task ReturnsUserReceivedEvents()
            {
                var userReceivedEvents = await _eventsClient.GetAllUserReceived(user).ToList();

                Assert.NotEmpty(userReceivedEvents);
            }