This commit is contained in:
@@ -61,8 +61,13 @@ namespace raven_integration
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
uint ConcurrencyToken = a.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
|
||||
|
||||
//HERE TODO: validate the repository LIST ROUTE of tags contains the ones above and that their refcount is 1
|
||||
//validate the repository LIST ROUTE of tags contains the ones above
|
||||
a = await Util.GetAsync($"TagPickList/list/" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(7);
|
||||
|
||||
|
||||
//UPDATE Tags
|
||||
@@ -74,22 +79,35 @@ namespace raven_integration
|
||||
UpdateTags.Add(s);
|
||||
}
|
||||
//update Widget and put to server
|
||||
w.concurrencyToken = a.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
|
||||
w.concurrencyToken = ConcurrencyToken;
|
||||
w.tags = UpdateTags;
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("Widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
|
||||
//Verify the tags collection remaining
|
||||
//HERE TODO: validate the repository LIST ROUTE of tags contains the ones above and that their refcount is 1
|
||||
//Verify the tags collection remaining
|
||||
a = await Util.GetAsync($"TagPickList/list/" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(9);
|
||||
|
||||
|
||||
//DELETE
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("Widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
//Verify the tags collection remaining
|
||||
a = await Util.GetAsync($"TagPickList/list/" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(0);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//TODO: Deliberate concurrency violation tests here
|
||||
//TODO: Deliberate concurrency violation tests here
|
||||
|
||||
|
||||
//==================================================
|
||||
|
||||
Reference in New Issue
Block a user