Пример #1
0
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableOrganizationHooksClient(Substitute.For <IGitHubClient>());

                var config = new Dictionary <string, string> {
                    { "config", "" }
                };

                Assert.Throws <ArgumentNullException>(() => client.Create(null, new NewOrganizationHook("name", config)));
                Assert.Throws <ArgumentNullException>(() => client.Create("org", null));
                Assert.Throws <ArgumentException>(() => client.Create("", new NewOrganizationHook("name", config)));
            }
Пример #2
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableOrganizationHooksClient(gitHubClient);

                var hook = new NewOrganizationHook("name", new Dictionary <string, string> {
                    { "config", "" }
                });

                client.Create("org", hook);

                gitHubClient.Received().Organization.Hook.Create("org", hook);
            }