This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@ namespace raven_integration
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.usertype = 1;
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace raven_integration
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace raven_integration
|
||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
w.notes = "blah";
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -78,13 +78,13 @@ namespace raven_integration
|
||||
a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace raven_integration
|
||||
w.endDate = DateTime.Now.AddHours(1);
|
||||
w.usertype = 1;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace raven_integration
|
||||
w.startDate = DateTime.Now.AddHours(1);
|
||||
w.endDate = DateTime.Now.AddHours(2);
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace raven_integration
|
||||
w.startDate = DateTime.Now.AddHours(2);
|
||||
w.endDate = DateTime.Now.AddHours(3);
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -171,13 +171,13 @@ namespace raven_integration
|
||||
a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
}
|
||||
@@ -205,7 +205,7 @@ namespace raven_integration
|
||||
w.count = 999;
|
||||
w.usertype = 1;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace raven_integration
|
||||
w.notes = "blah";
|
||||
w.count = 665;
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace raven_integration
|
||||
w.notes = "blah";
|
||||
w.count = 333;
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -260,13 +260,13 @@ namespace raven_integration
|
||||
a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
}
|
||||
@@ -315,7 +315,7 @@ namespace raven_integration
|
||||
w.count = 1;
|
||||
w.usertype = 1;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
FourthInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -326,7 +326,7 @@ namespace raven_integration
|
||||
w.dollaramount = 1.11;
|
||||
w.count = 2;
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace raven_integration
|
||||
w.dollaramount = 1.11;
|
||||
w.count = 1;
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -348,7 +348,7 @@ namespace raven_integration
|
||||
w.dollaramount = 2.22;
|
||||
w.count = 2;
|
||||
w.usertype = 1;
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -393,16 +393,16 @@ namespace raven_integration
|
||||
a.ObjectResponse["data"][3][0]["i"].Value<long>().Should().Be(FourthInOrderWidgetId);
|
||||
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + FourthInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + FourthInOrderWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace raven_integration
|
||||
w.usertype = 1;
|
||||
|
||||
//*** CREATED
|
||||
ApiResponse r2 = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), w.ToString());
|
||||
ApiResponse r2 = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(r2);
|
||||
long w2Id = r2.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace raven_integration
|
||||
|
||||
//*** RETRIEVED
|
||||
//Get one
|
||||
ApiResponse r3 = await Util.GetAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("InventoryFull"));
|
||||
ApiResponse r3 = await Util.GetAsync("widget/" + w2Id.ToString(), await Util.GetTokenAsync("InventoryFull"));
|
||||
Util.ValidateDataReturnResponseOk(r3);
|
||||
r3.ObjectResponse["data"]["name"].Value<string>().Should().Be(w.name.ToString());
|
||||
w = r3.ObjectResponse["data"];
|
||||
@@ -73,12 +73,12 @@ namespace raven_integration
|
||||
w.name = Util.Uniquify("UPDATED VIA PUT EVENTLOG TEST WIDGET");
|
||||
w.UserId = 1;
|
||||
w.concurrency = r2.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("Widget", await Util.GetTokenAsync("InventoryFull"), w.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("widget", await Util.GetTokenAsync("InventoryFull"), w.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
//*** RETRIEVED
|
||||
//check PUT worked
|
||||
ApiResponse checkPUTWorked = await Util.GetAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("InventoryFull"));
|
||||
ApiResponse checkPUTWorked = await Util.GetAsync("widget/" + w2Id.ToString(), await Util.GetTokenAsync("InventoryFull"));
|
||||
Util.ValidateNoErrorInResponse(checkPUTWorked);
|
||||
checkPUTWorked.ObjectResponse["data"]["name"].Value<string>().Should().Be(w.name.ToString());
|
||||
uint concurrency = PUTTestResponse.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
@@ -101,7 +101,7 @@ namespace raven_integration
|
||||
|
||||
|
||||
//DELETE
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("InventoryFull"));
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("widget/" + w2Id.ToString(), await Util.GetTokenAsync("InventoryFull"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
//All events should be cleared up on deletion with the sole exception of the deleted event
|
||||
@@ -156,7 +156,7 @@ namespace raven_integration
|
||||
d.active = true;
|
||||
d.usertype = 1;
|
||||
d.notes = "note here";
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync(UniqueName, UniqueName), d.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync(UniqueName, UniqueName), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ namespace raven_integration
|
||||
w.usertype = 1;
|
||||
w.dollarAmount = 555.55;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
IncludedWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -303,7 +303,7 @@ namespace raven_integration
|
||||
pickList[0]["name"].Value<string>().Should().Contain("_a1b2c3");
|
||||
|
||||
//DELETE WIDGETS
|
||||
a = await Util.DeleteAsync("Widget/" + IncludedWidgetId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.DeleteAsync("widget/" + IncludedWidgetId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ namespace raven_integration
|
||||
InclusiveTagsArray.Add("plblue");
|
||||
w.tags = InclusiveTagsArray;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
IncludedWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace raven_integration
|
||||
pickList[0]["id"].Value<long>().Should().Be(IncludedWidgetId);
|
||||
|
||||
//DELETE WIDGETS
|
||||
a = await Util.DeleteAsync("Widget/" + IncludedWidgetId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.DeleteAsync("widget/" + IncludedWidgetId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
}
|
||||
|
||||
@@ -376,14 +376,14 @@ namespace raven_integration
|
||||
w.active = true;
|
||||
w.usertype = 1;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
//second active widget
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
@@ -392,7 +392,7 @@ namespace raven_integration
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.active = false;
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
NotActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
@@ -400,7 +400,7 @@ namespace raven_integration
|
||||
w.name = Util.Uniquify(WidgetNameStart);
|
||||
w.active = false;
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
NotActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
@@ -445,13 +445,13 @@ namespace raven_integration
|
||||
//DELETE WIDGETS
|
||||
foreach (long l in ActiveWidgetIdList)
|
||||
{
|
||||
a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.DeleteAsync("widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
}
|
||||
|
||||
foreach (long l in NotActiveWidgetIdList)
|
||||
{
|
||||
a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
a = await Util.DeleteAsync("widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This record will match in notes: The quick brown and simple fox jumped over the six lazy dogs!";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This Widget matches in name";
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This Widget should not be returned in the search as it only contains a single keyword in the name not both";
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchNothingWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace raven_integration
|
||||
D.notes = "This record will match in notes: The quick brown and hapless goose";
|
||||
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This record will match in notes: react to the goose";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "This record will match in notes: broadcasting to the goose";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -378,7 +378,7 @@ namespace raven_integration
|
||||
D.notes = "This record will match in notes and tag: elementary my dear aardvark";
|
||||
D.tags = TagsArray;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -395,7 +395,7 @@ namespace raven_integration
|
||||
D.notes = "This record will match in tag but no search phrase";
|
||||
D.tags = TagsArray;
|
||||
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long NoPhraseMatchWidgetInTagId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -539,7 +539,7 @@ namespace raven_integration
|
||||
D.usertype = 1;
|
||||
D.notes = "Test for serial number search";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInSerialId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
var MatchWidgetSerial = a.ObjectResponse["data"]["serial"].Value<uint>();
|
||||
@@ -619,7 +619,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
D.usertype = 1;
|
||||
D.notes = "This record will match in custom field";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchingWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -650,7 +650,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
|
||||
//Now delete the newly created one so the list doesn't build up and prevent this test from working in big runs...
|
||||
//DELETE
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("Widget/" + MatchingWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("widget/" + MatchingWidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
|
||||
@@ -673,7 +673,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
d.usertype = 1;
|
||||
d.notes = $"This record will match in notes: {TEST_SEARCH_PHRASE} there";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WidgetId = (long)a.ObjectResponse["data"]["id"];
|
||||
|
||||
@@ -688,7 +688,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(1);
|
||||
|
||||
//Now delete the widget and re-run the search
|
||||
a = await Util.DeleteAsync("Widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void TestJobShouldSubmit()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Widget/TestWidgetJob", await Util.GetTokenAsync("OpsAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("widget/TestWidgetJob", await Util.GetTokenAsync("OpsAdminFull"));
|
||||
//Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 202);
|
||||
//should return something like this:
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace raven_integration
|
||||
}
|
||||
w.tags = InitialTags;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
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 Concurrency = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
@@ -86,7 +86,7 @@ namespace raven_integration
|
||||
//update Widget and put to server
|
||||
w.concurrency = Concurrency;
|
||||
w.tags = UpdateTags;
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace raven_integration
|
||||
a.ObjectResponse["data"][0]["refCount"].Value<long>().Should().Be(1);
|
||||
|
||||
//DELETE
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("Widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
//Verify the tags collection remaining
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace raven_integration
|
||||
|
||||
|
||||
//RETRIEVE companion USEROPTIONS object
|
||||
ApiResponse R = await Util.GetAsync("UserOptions/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R = await Util.GetAsync("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(R);
|
||||
//ensure the default value is set
|
||||
R.ObjectResponse["data"]["uiColor"].Value<string>().Should().Be("#000000");
|
||||
@@ -146,11 +146,11 @@ namespace raven_integration
|
||||
D2.translationId = NewId;
|
||||
|
||||
D2.concurrency = concurrency;
|
||||
PUTTestResponse = await Util.PutAsync("UserOptions/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
|
||||
PUTTestResponse = await Util.PutAsync("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
//VALIDATE
|
||||
R = await Util.GetAsync("UserOptions/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
R = await Util.GetAsync("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(R);
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace raven_integration
|
||||
//Now there should be a user options available for this user
|
||||
|
||||
//RETRIEVE companion USEROPTIONS object
|
||||
R = await Util.GetAsync("UserOptions/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(R);
|
||||
//ensure the default value is set
|
||||
R.ObjectResponse["data"]["uiColor"].Value<string>().Should().Be("#000000");
|
||||
@@ -53,11 +53,11 @@ namespace raven_integration
|
||||
D2.hour12 = false;
|
||||
D2.uiColor = "#ffaaff";
|
||||
D2.concurrency = concurrency;
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("UserOptions/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
//VALIDATE
|
||||
R = await Util.GetAsync("UserOptions/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(R);
|
||||
//ensure the default value is set
|
||||
/*
|
||||
@@ -78,7 +78,7 @@ namespace raven_integration
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
//CHECK DELETE USER REMOVED USEROPTIONS
|
||||
R = await Util.GetAsync("UserOptions/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateResponseNotFound(R);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace raven_integration
|
||||
{
|
||||
//Get non existant
|
||||
//Should return status code 404, api error code 2010
|
||||
ApiResponse R = await Util.GetAsync("UserOptions/999999", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R = await Util.GetAsync("user-option/999999", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateResponseNotFound(R);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace raven_integration
|
||||
{
|
||||
//Get non existant
|
||||
//Should return status code 400, api error code 2200 and a first target in details of "id"
|
||||
ApiResponse R = await Util.GetAsync("UserOptions/2q2", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R = await Util.GetAsync("user-option/2q2", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateBadModelStateResponse(R, "id");
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("VIOLET Tag");
|
||||
w1.tags = dTagsArray;
|
||||
|
||||
ApiResponse r1 = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w1.ToString());
|
||||
ApiResponse r1 = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w1.ToString());
|
||||
Util.ValidateDataReturnResponseOk(r1);
|
||||
long w1Id = r1.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -57,14 +57,14 @@ namespace raven_integration
|
||||
w2.tags = dTagsArray;
|
||||
w2.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
|
||||
ApiResponse r2 = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
ApiResponse r2 = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
Util.ValidateDataReturnResponseOk(r2);
|
||||
long w2Id = r2.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//RETRIEVE
|
||||
|
||||
//Get one
|
||||
ApiResponse r3 = await Util.GetAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse r3 = await Util.GetAsync("widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(r3);
|
||||
r3.ObjectResponse["data"]["name"].Value<string>().Should().Be(w2.name.ToString());
|
||||
r3.ObjectResponse["data"]["notes"].Value<string>().Should().Be(w2.notes.ToString());
|
||||
@@ -87,17 +87,17 @@ namespace raven_integration
|
||||
w2.name = Util.Uniquify("UPDATED VIA PUT SECOND TEST WIDGET");
|
||||
w2.id = w2Id;
|
||||
w2.concurrency = r2.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
//check PUT worked
|
||||
ApiResponse checkPUTWorked = await Util.GetAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse checkPUTWorked = await Util.GetAsync("widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateNoErrorInResponse(checkPUTWorked);
|
||||
checkPUTWorked.ObjectResponse["data"]["name"].Value<string>().Should().Be(w2.name.ToString());
|
||||
uint concurrency = PUTTestResponse.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
|
||||
//DELETE
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("Widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("widget/" + w2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace raven_integration
|
||||
{
|
||||
//Get non existant
|
||||
//Should return status code 404, api error code 2010
|
||||
ApiResponse a = await Util.GetAsync("Widget/999999", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("widget/999999", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateResponseNotFound(a);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace raven_integration
|
||||
{
|
||||
//Get non existant
|
||||
//Should return status code 400, api error code 2200 and a first target in details of "id"
|
||||
ApiResponse a = await Util.GetAsync("Widget/2q2", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("widget/2q2", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateBadModelStateResponse(a, "id");
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace raven_integration
|
||||
{
|
||||
//Get non existant
|
||||
//Should return status code 400, api error code 2200 and a first target in details of "id"
|
||||
ApiResponse a = await Util.GetAsync("Widget/exception", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("widget/exception", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateServerExceptionResponse(a);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace raven_integration
|
||||
{
|
||||
//Get non existant
|
||||
//Should return status code 400, api error code 2200 and a first target in details of "id"
|
||||
ApiResponse a = await Util.GetAsync("Widget/altexception", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("widget/altexception", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateServerExceptionResponse(a);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace raven_integration
|
||||
w2.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||
|
||||
|
||||
ApiResponse r2 = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
ApiResponse r2 = await Util.PostAsync("widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
Util.ValidateDataReturnResponseOk(r2);
|
||||
uint OriginalConcurrencyToken = r2.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
w2 = r2.ObjectResponse["data"];
|
||||
@@ -188,7 +188,7 @@ namespace raven_integration
|
||||
|
||||
w2.name = Util.Uniquify("PutConcurrencyViolationShouldFail UPDATE VIA PUT ");
|
||||
w2.concurrency = OriginalConcurrencyToken - 1;//bad token
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("Widget/", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("widget/", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());
|
||||
Util.ValidateConcurrencyError(PUTTestResponse);
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void ServerShouldNotAllowUnauthenticatedAccess()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Widget/list");
|
||||
ApiResponse a = await Util.GetAsync("widget/list");
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void ServerShouldNotAllowReadUnauthorizedAccess()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("Widget/listwidgets", await Util.GetTokenAsync( "OpsAdminFull"));
|
||||
ApiResponse a = await Util.GetAsync("widget/listwidgets", await Util.GetTokenAsync( "OpsAdminFull"));
|
||||
//2004 unauthorized
|
||||
Util.ValidateErrorCodeResponse(a, 2004, 403);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace raven_integration
|
||||
d.usertype = 1;
|
||||
|
||||
//BizAdminLimited user should not be able to create a widget, only read them
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync( "BizAdminLimited"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync( "BizAdminLimited"), d.ToString());
|
||||
|
||||
//2004 unauthorized
|
||||
Util.ValidateErrorCodeResponse(a, 2004, 403);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace raven_integration
|
||||
// d.usertype = 1;
|
||||
|
||||
// //create via inventory full test user
|
||||
// ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
// ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
|
||||
// Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
// Util.ShouldContainValidationError(a, "Active", "2203");
|
||||
@@ -53,11 +53,11 @@ namespace raven_integration
|
||||
d.usertype = 1;
|
||||
|
||||
//create via inventory full test user
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now try to create again with same name
|
||||
a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
|
||||
//2002 in-valid expected
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
@@ -82,7 +82,7 @@ namespace raven_integration
|
||||
d.usertype = 1;
|
||||
|
||||
//create via inventory full test user
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
|
||||
|
||||
//2002 in-valid expected
|
||||
@@ -108,7 +108,7 @@ namespace raven_integration
|
||||
d.usertype = 1;
|
||||
|
||||
//create via inventory full test user
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
|
||||
|
||||
//2002 in-valid expected
|
||||
@@ -137,7 +137,7 @@ namespace raven_integration
|
||||
d.usertype = 1;
|
||||
|
||||
//create via inventory full test user
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
|
||||
|
||||
//2002 in-valid expected
|
||||
@@ -165,7 +165,7 @@ namespace raven_integration
|
||||
d.usertype = 1;
|
||||
|
||||
//create via inventory full test user
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
|
||||
|
||||
//2002 in-valid expected
|
||||
@@ -193,7 +193,7 @@ namespace raven_integration
|
||||
d.usertype = 1;
|
||||
|
||||
//create via inventory full test user
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
|
||||
|
||||
//2002 in-valid expected
|
||||
@@ -224,7 +224,7 @@ namespace raven_integration
|
||||
|
||||
|
||||
//create via inventory full test user
|
||||
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
|
||||
|
||||
|
||||
//2002 in-valid expected
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("wo-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("workorders", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("workorder", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic WorkorderToUpdate = a.ObjectResponse["data"];
|
||||
long WorkOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -52,7 +52,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitem-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic WorkOrderItemToUpdate = a.ObjectResponse["data"];
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitempart-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic dPartToUpdate = a.ObjectResponse["data"];
|
||||
long PartId = (long)a.ObjectResponse["data"]["id"];
|
||||
@@ -95,7 +95,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic dLaborOne = a.ObjectResponse["data"];
|
||||
long Labor1Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -114,7 +114,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItemLaborId2 = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitem-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItem2Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitempart-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//TWO-2
|
||||
@@ -196,7 +196,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("expense-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/expenses", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/expenses", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("loan-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/loans", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/loans", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("partrequest-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/partrequests", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/partrequests", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//scheduleduser
|
||||
@@ -267,7 +267,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("scheduleduser-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/scheduledusers", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/scheduledusers", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("task-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/tasks", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/tasks", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("travel-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/travels", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/travels", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("unit-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/units", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/units", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
#endregion create second woitem
|
||||
@@ -332,19 +332,19 @@ namespace raven_integration
|
||||
//
|
||||
|
||||
dLaborOne.notes = "UpdatedLaborNotes";
|
||||
a = await Util.PutAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), dLaborOne.ToString());
|
||||
a = await Util.PutAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), dLaborOne.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
dPartToUpdate.notes = "UpdatedPartNotes";
|
||||
a = await Util.PutAsync("workorders/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), dPartToUpdate.ToString());
|
||||
a = await Util.PutAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), dPartToUpdate.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
WorkOrderItemToUpdate.notes = "UpdatedWoItemNotes";
|
||||
a = await Util.PutAsync("workorders/items", await Util.GetTokenAsync("manager", "l3tm3in"), WorkOrderItemToUpdate.ToString());
|
||||
a = await Util.PutAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), WorkOrderItemToUpdate.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
WorkorderToUpdate.notes = "UpdatedWoNotes";
|
||||
a = await Util.PutAsync("workorders", await Util.GetTokenAsync("manager", "l3tm3in"), WorkorderToUpdate.ToString());
|
||||
a = await Util.PutAsync("workorder", await Util.GetTokenAsync("manager", "l3tm3in"), WorkorderToUpdate.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
#endregion update
|
||||
@@ -352,7 +352,7 @@ namespace raven_integration
|
||||
#region Validate all create and update
|
||||
|
||||
//RETRIEVE WORKORDER AND VALIDATE ENTIRE
|
||||
a = await Util.GetAsync("workorders/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
var w = a.ObjectResponse["data"];
|
||||
@@ -387,19 +387,19 @@ namespace raven_integration
|
||||
#endregion validate entire
|
||||
|
||||
#region DELETE
|
||||
a = await Util.DeleteAsync("workorders/items/labors/" + Labor1Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("workorder/items/labors/" + Labor1Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
a = await Util.GetAsync("workorders/items/labors/" + Labor1Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/items/labors/" + Labor1Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 404);
|
||||
|
||||
a = await Util.DeleteAsync("workorders/items/" + WorkOrderItem2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("workorder/items/" + WorkOrderItem2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
a = await Util.GetAsync("workorders/items/" + WorkOrderItem2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/items/" + WorkOrderItem2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 404);
|
||||
|
||||
a = await Util.DeleteAsync("workorders/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
a = await Util.GetAsync("workorders/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 404);
|
||||
|
||||
#endregion delete
|
||||
@@ -423,7 +423,7 @@ namespace raven_integration
|
||||
d.notes = "WOHEADER";
|
||||
d.wiki = "INTEGRATION_DELETE_TEST_FAIL_BEFORE_COMMIT";//<-- key phrase triggers server exception in Workorder immediately before it would normally commit the whole thing
|
||||
|
||||
a = await Util.PostAsync("workorders", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -431,7 +431,7 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderId = WorkOrderId;
|
||||
a = await Util.PostAsync("workorders/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItem1Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -439,7 +439,7 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
a = await Util.PostAsync("workorders/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//CREATE TWO WOITEMLABORS
|
||||
@@ -447,21 +447,21 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//TWO
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//CREATE WOITEM-2
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderId = WorkOrderId;
|
||||
a = await Util.PostAsync("workorders/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItem2Id = (long)a.ObjectResponse["data"]["id"];
|
||||
|
||||
@@ -469,7 +469,7 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorders/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//CREATE WOITEMLABOR(S)-2
|
||||
@@ -477,22 +477,22 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//TWO-2
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
a = await Util.DeleteAsync("workorders/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateServerExceptionResponse(a);
|
||||
|
||||
//now confirm the workorder is still there and with it's children intact
|
||||
//RETRIEVE WORKORDER AND VALIDATE ENTIRE
|
||||
a = await Util.GetAsync("workorders/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
var w = a.ObjectResponse["data"];
|
||||
@@ -528,7 +528,7 @@ namespace raven_integration
|
||||
d.notes = "WOHEADER DuplicateWorks";
|
||||
d.wiki = "DuplicateWorks integration test";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("workorders", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("workorder", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic WorkorderToUpdate = a.ObjectResponse["data"];
|
||||
long WorkOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -542,7 +542,7 @@ namespace raven_integration
|
||||
d.wiki = "# woitem test wiki";
|
||||
d.workOrderId = WorkOrderId;
|
||||
|
||||
a = await Util.PostAsync("workorders/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic WorkOrderItemToUpdate = a.ObjectResponse["data"];
|
||||
long WorkOrderItem1Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -554,7 +554,7 @@ namespace raven_integration
|
||||
d.wiki = "# woitempart test wiki";
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic dPartToUpdate = a.ObjectResponse["data"];
|
||||
long PartId = (long)a.ObjectResponse["data"]["id"];
|
||||
@@ -568,7 +568,7 @@ namespace raven_integration
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
|
||||
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic dLaborOne = a.ObjectResponse["data"];
|
||||
long Labor1Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -581,7 +581,7 @@ namespace raven_integration
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
|
||||
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItemLaborId2 = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -598,7 +598,7 @@ namespace raven_integration
|
||||
d.wiki = "# woitem test wiki";
|
||||
d.workOrderId = WorkOrderId;
|
||||
|
||||
a = await Util.PostAsync("workorders/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItem2Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -609,7 +609,7 @@ namespace raven_integration
|
||||
d.wiki = "# woitempart test wiki";
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//CREATE WOITEMLABOR(S)-2
|
||||
@@ -619,7 +619,7 @@ namespace raven_integration
|
||||
d.notes = "woitem-2-laborDuplicateWorks";
|
||||
d.wiki = "# woitemlabor test wiki";
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//TWO-2
|
||||
@@ -628,7 +628,7 @@ namespace raven_integration
|
||||
d.notes = "woitem-2-labor2DuplicateWorks";
|
||||
d.wiki = "# woitemlabor2 test wiki";
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
#endregion create second woitem
|
||||
@@ -638,13 +638,13 @@ namespace raven_integration
|
||||
#region Duplicate and Validate
|
||||
|
||||
//DUPLICATE - should make a copy of above, save and return entire object graph just like a get operation
|
||||
a = await Util.PostAsync("workorders/duplicate/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/duplicate/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long DuplicateWorkOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
DuplicateWorkOrderId.Should().NotBe(WorkOrderId);
|
||||
|
||||
// //RETRIEVE WORKORDER AND VALIDATE ENTIRE
|
||||
// a = await Util.GetAsync("workorders/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
// a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
var w = a.ObjectResponse["data"];
|
||||
|
||||
Reference in New Issue
Block a user