예제 #1
0
        /// <summary>
        /// Update a check.
        /// </summary>
        /// <param name="checkId">ID of check</param>
        /// <param name="patch">update to apply</param>
        /// <returns>An updated check</returns>
        public async Task <Check> UpdateCheckAsync(string checkId, CheckPatch patch)
        {
            Arguments.CheckNonEmptyString(checkId, nameof(checkId));
            Arguments.CheckNotNull(patch, nameof(patch));

            return(await _service.PatchChecksIDAsync(checkId, patch));
        }
예제 #2
0
        public void UpdateCheckNotExists()
        {
            var update = new CheckPatch(name: "not exits name", description: "not exists update",
                                        status: CheckPatch.StatusEnum.Active);

            var ioe = Assert.ThrowsAsync <HttpException>(async() => await _checksApi
                                                         .UpdateCheckAsync("020f755c3c082000", update));

            Assert.AreEqual("check not found for key \"020f755c3c082000\"", ioe.Message);
        }