示例#1
0
 /// <summary>
 /// Updates this webhook on the server.
 /// </summary>
 public void Update()
 {
     if (Parent != null)
     {
         Webhook.Update(Parent.Parent.CurrentConfig, this, Parent);
     }
     else
     {
         throw new GitLabStaticAccessException("Unable to save Webhook without parent project");
     }
 }
示例#2
0
        public void TestCRUD()
        {
            Webhook webhook = Webhook.Create(new Dictionary <string, object>()
            {
                { "url", "https://www.foobar.com" }
            });

            Assert.AreEqual(webhook.url, "https://www.foobar.com");

            webhook.Update();

            List <Webhook> webhooks = Webhook.List();

            CollectionAssert.Contains(webhooks.Select(w => w.id).ToList(), webhook.id);

            webhook.Destroy();
            try {
                User.Retrieve(webhook.id);
                Assert.Fail();
            }
            catch (HttpException) { }
        }