This commit is contained in:
@@ -11,6 +11,7 @@ namespace raven_integration
|
||||
|
||||
/// <summary>
|
||||
/// Test all CRUD routes for a WorkOrder
|
||||
/// Build up graph, update graph, remove graph bit by bit
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async void CRUD()
|
||||
@@ -51,6 +52,8 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItemId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
|
||||
//CREATE WOITEMPART
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
@@ -70,13 +73,57 @@ namespace raven_integration
|
||||
long WorkOrderItemPartId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
|
||||
//CREATE WOITEMLABOR(S)
|
||||
|
||||
//ONE
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.notes = "woitemlabor The quick brown fox jumped over the six lazy dogs!";
|
||||
d.wiki = "# woitemlabor test wiki";
|
||||
d.workOrderItemId = WorkOrderItemId;
|
||||
|
||||
//Tags
|
||||
dTagsArray = new JArray();
|
||||
dTagsArray.Add("woitemlabor-Red");
|
||||
dTagsArray.Add("woitemlabor-green");
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItemLaborId1 = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//TWO
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.notes = "woitemlabor2 The quick brown fox jumped over the six lazy dogs!";
|
||||
d.wiki = "# woitemlabor2 test wiki";
|
||||
d.workOrderItemId = WorkOrderItemId;
|
||||
|
||||
//Tags
|
||||
dTagsArray = new JArray();
|
||||
dTagsArray.Add("woitemlabor-Red");
|
||||
dTagsArray.Add("woitemlabor-green");
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorders/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItemLaborId2 = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//RETRIEVE
|
||||
|
||||
//Get one
|
||||
a = await Util.GetAsync("workorders/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
a.ObjectResponse["data"]["notes"].Value<string>().Should().Be("WOHEADER The quick brown fox jumped over the six lazy dogs!");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user