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

                await AssertEx.Throws <ArgumentNullException>(async() => await client.GetForAnOrganization(null, "org"));

                await AssertEx.Throws <ArgumentException>(async() => await client.GetForAnOrganization("", "org"));

                await AssertEx.Throws <ArgumentNullException>(async() => await client.GetForAnOrganization("fake", null));

                await AssertEx.Throws <ArgumentException>(async() => await client.GetForAnOrganization("fake", ""));
            }
コード例 #2
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableEventsClient(gitHubClient);

                client.GetForAnOrganization("fake", "org");

                gitHubClient.Connection.Received(1).Get <List <Activity> >(new Uri("users/fake/events/orgs/org", UriKind.Relative), null, null);
            }