Beispiel #1
0
        /// <summary>
        /// Edits a hook for a organization
        /// </summary>
        /// <param name="org">The organizations name</param>
        /// <param name="hookId">The organizations hook id</param>
        /// <param name="hook">The hook's parameters</param>
        /// <remarks>See <a href="http://developer.github.com/v3/orgs/hooks/#edit-a-hook">API documentation</a> for more information.</remarks>
        /// <returns></returns>
        public IObservable <OrganizationHook> Edit(string org, int hookId, EditOrganizationHook hook)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(hook, nameof(hook));

            return(_client.Edit(org, hookId, hook).ToObservable());
        }
Beispiel #2
0
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new OrganizationsClient(connection);
                var hook       = new EditOrganizationHook();

                client.Hook.Edit("org", 12345678, hook);

                connection.Received().Patch <OrganizationHook>(Arg.Is <Uri>(u => u.ToString() == "orgs/org/hooks/12345678"), hook);
            }
Beispiel #3
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableOrganizationHooksClient(gitHubClient);

                var hook = new EditOrganizationHook();

                client.Edit("org", 12345678, hook);

                gitHubClient.Received().Organization.Hook.Edit("org", 12345678, hook);
            }
Beispiel #4
0
            public void UsesTheSuppliedHook()
            {
                var connection           = Substitute.For <IApiConnection>();
                var client               = new OrganizationsClient(connection);
                var editOrganizationHook = new EditOrganizationHook()
                {
                    Active = false
                };

                client.Hook.Edit("org", 12345678, editOrganizationHook);

                connection.Received().Patch <OrganizationHook>(Arg.Any <Uri>(), editOrganizationHook);
            }