From 8f75d03404d463c50fe243dfd3011abf14109376 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 13 May 2020 19:46:06 +0000 Subject: [PATCH] Ditched PATCH --- Widget/WidgetCrud.cs | 46 -------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/Widget/WidgetCrud.cs b/Widget/WidgetCrud.cs index 56a7669..66c10a8 100644 --- a/Widget/WidgetCrud.cs +++ b/Widget/WidgetCrud.cs @@ -96,17 +96,6 @@ namespace raven_integration checkPUTWorked.ObjectResponse["data"]["name"].Value().Should().Be(w2.name.ToString()); uint concurrencyToken = PUTTestResponse.ObjectResponse["data"]["concurrencyToken"].Value(); - //PATCH - var newName = Util.Uniquify("UPDATED VIA PATCH SECOND TEST WIDGET"); - string patchJson = "[{\"value\": \"" + newName + "\",\"path\": \"/name\",\"op\": \"replace\"}]"; - ApiResponse PATCHTestResponse = await Util.PatchAsync("Widget/" + w2Id.ToString() + "/" + concurrencyToken.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), patchJson); - Util.ValidateHTTPStatusCode(PATCHTestResponse, 200); - - //check PATCH worked - ApiResponse checkPATCHWorked = await Util.GetAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in")); - Util.ValidateNoErrorInResponse(checkPATCHWorked); - checkPATCHWorked.ObjectResponse["data"]["name"].Value().Should().Be(newName); - //DELETE ApiResponse DELETETestResponse = await Util.DeleteAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in")); Util.ValidateHTTPStatusCode(DELETETestResponse, 204); @@ -212,41 +201,6 @@ namespace raven_integration - /// - /// - /// - [Fact] - public async void PatchConcurrencyViolationShouldFail() - { - - //CREATE - - dynamic w2 = new JObject(); - w2.name = Util.Uniquify("PatchConcurrencyViolationShouldFail"); - w2.notes="blah"; - w2.customFields = Util.WidgetRequiredCustomFieldsJsonString(); - w2.dollarAmount = 2.22m; - w2.active = true; - w2.usertype = 1; - w2.customFields = Util.WidgetRequiredCustomFieldsJsonString(); - - ApiResponse r2 = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString()); - Util.ValidateDataReturnResponseOk(r2); - long w2Id = r2.ObjectResponse["data"]["id"].Value(); - uint OriginalConcurrencyToken = r2.ObjectResponse["data"]["concurrencyToken"].Value(); - - - //PATCH - var newName = Util.Uniquify("PutConcurrencyViolationShouldFail UPDATED VIA PATCH"); - string patchJson = "[{\"value\": \"" + newName + "\",\"path\": \"/name\",\"op\": \"replace\"}]"; - ApiResponse PATCHTestResponse = await Util.PatchAsync("Widget/" + w2Id.ToString() + "/" + (OriginalConcurrencyToken - 1).ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), patchJson); - Util.ValidateConcurrencyError(PATCHTestResponse); - } - - - - - //================================================== }//eoc