예제 #1
0
        public void Test_Hooks_Update()
        {
            try
            {
                HookDTO hook = this.GetJohnsHook();
                HookPutDTO hookPut = new HookPutDTO();
                hookPut.Status = hook.Status;
                hookPut.Url = String.Format("http://test{0}.com", DateTime.Now.Ticks);

                HookDTO saveHook = this.Api.Hooks.Update(hookPut, hook.Id);

                Assert.AreEqual(saveHook.Id, hook.Id);
                Assert.AreEqual(hookPut.Url, saveHook.Url);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
예제 #2
0
 /// <summary>Saves a hook.</summary>
 /// <param name="hook">Hook instance to save.</param>
 /// <param name="hookId">Hook identifier.</param>
 /// <returns>Hook instance returned from API.</returns>
 public HookDTO Update(HookPutDTO hook, String hookId)
 {
     return this.UpdateObject<HookDTO, HookPutDTO>(MethodKey.HooksSave, hook, hookId);
 }