Пример #1
0
            public async Task EnsuresArgumentsNotNull()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableEventsClient(gitHubClient);

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

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetAllUserPerformed("").ToTask());
            }
Пример #2
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableEventsClient(gitHubClient);

                client.GetAllUserPerformed("fake");

                gitHubClient.Connection.Received(1).Get <List <Activity> >(new Uri("users/fake/events", UriKind.Relative), Args.EmptyDictionary, null);
            }
Пример #3
0
            public async Task ReturnsUserPerformedEvents()
            {
                var userPerformedEvents = await _eventsClient.GetAllUserPerformed(user).ToList();

                Assert.NotEmpty(userPerformedEvents);
            }