Compare commits
10 Commits
29d76aa6b1
...
d914f6940d
| Author | SHA1 | Date | |
|---|---|---|---|
| d914f6940d | |||
| 9c9ec3ac2a | |||
| ff1ed73b01 | |||
| 89474cfb3c | |||
| 2d7bbd7a47 | |||
| 09c18de8e4 | |||
| 7cc4911faf | |||
| e7f9e38917 | |||
| 938f0bbe50 | |||
| 4446c19c9a |
@@ -36,7 +36,7 @@ namespace raven_integration
|
||||
d.notes = "notes";
|
||||
d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long TestUserId=a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace raven_integration
|
||||
formDataContent.Add(file2);
|
||||
|
||||
//create via inventory full test user as attachments use the role of the object attaching to
|
||||
a = await Util.PostFormDataAsync("attachment", formDataContent, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.PostFormDataAsync("attachment", formDataContent, await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
|
||||
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
@@ -99,10 +99,10 @@ namespace raven_integration
|
||||
|
||||
//////////////////////////////////////////
|
||||
//// DELETE: Delete the file attachments
|
||||
a = await Util.DeleteAsync("attachment/" + lTestPngAttachmentId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("attachment/" + lTestPngAttachmentId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("attachment/" + lTestZipAttachmentId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("attachment/" + lTestZipAttachmentId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace raven_integration
|
||||
public async void JWTExpiredTokenShouldFail()
|
||||
{
|
||||
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTWrongIssuerShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
@@ -71,7 +71,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTNoAlgorithmShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
@@ -86,7 +86,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTBadSecretShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
@@ -102,7 +102,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTTruncatedSignatureShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
@@ -118,7 +118,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void JWTTransposedSignatureShouldFail()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||
if (BuildMode == "DEBUG")
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@ namespace raven_integration
|
||||
public async void DataListReturnFormatShouldWorkAsExpected()
|
||||
{
|
||||
|
||||
ApiResponse a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(null, 3, 2));
|
||||
ApiResponse a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(null, 3, 2));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace raven_integration
|
||||
*/
|
||||
|
||||
//FETCH DATALIST
|
||||
ApiResponse a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
ApiResponse a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -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("superuser", "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("superuser", "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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -64,8 +64,8 @@ namespace raven_integration
|
||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart));
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
// a = await Util.GetAsync($"data-list/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
// a = await Util.GetAsync($"data-list/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -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("superuser", "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("superuser", "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("superuser", "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("superuser", "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("superuser", "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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace raven_integration
|
||||
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -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("superuser", "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("superuser", "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("superuser", "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("superuser", "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("superuser", "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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace raven_integration
|
||||
dListView.Add(Util.BuildSimpleSortDataListViewColumn("widgetcount", "-"));
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -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("superuser", "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("superuser", "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("superuser", "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("superuser", "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("superuser", "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("superuser", "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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -379,7 +379,7 @@ namespace raven_integration
|
||||
|
||||
|
||||
//NOW FETCH WIDGET LIST WITH FILTER
|
||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("manager", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
@@ -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("superuser", "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("superuser", "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("superuser", "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("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void GetListOfEnumListsAndGetAllEnumListsWorks()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("enum-list/listkeys", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("enum-list/listkeys", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(2);
|
||||
@@ -25,7 +25,7 @@ namespace raven_integration
|
||||
foreach (JObject jListName in a.ObjectResponse["data"])
|
||||
{
|
||||
|
||||
ApiResponse b = await Util.GetAsync($"enum-list/list/{jListName["key"].Value<string>()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse b = await Util.GetAsync($"enum-list/list/{jListName["key"].Value<string>()}", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(b);
|
||||
Util.ValidateHTTPStatusCode(b, 200);
|
||||
((JArray)b.ObjectResponse["data"]).Count.Should().BeGreaterThan(1);
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace raven_integration
|
||||
d.notes = "notes";
|
||||
d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long UserId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace raven_integration
|
||||
d.notes = "notes";
|
||||
d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long InNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace raven_integration
|
||||
d.notes = "notes";
|
||||
d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long InEmployeeNumberId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -113,10 +113,10 @@ namespace raven_integration
|
||||
pickList[0]["id"].Value<long>().Should().Be(InNameId);
|
||||
|
||||
//DELETE TEST USERS NO LONGER NEEDED
|
||||
a = await Util.DeleteAsync("User/" + InNameId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("User/" + InNameId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("User/" + InEmployeeNumberId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("User/" + InEmployeeNumberId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void FetchWidgetPickListPreDefined()
|
||||
{
|
||||
//fetch the manager account which always exists
|
||||
//fetch the SuperUser account which always exists
|
||||
ApiResponse a = await Util.GetAsync("pick-list/list?ayaType=3&preId=1", await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
//assert contains 1 record
|
||||
@@ -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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
IncludedWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
IncludedWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -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("superuser", "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("superuser", "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("superuser", "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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
NotActiveWidgetIdList.Add(a.ObjectResponse["data"]["id"].Value<long>());
|
||||
|
||||
|
||||
@@ -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("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace raven_integration
|
||||
|
||||
D.userType = 3;//non scheduleable
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace raven_integration
|
||||
|
||||
D.userType = 3;//non scheduleable
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNotesId = 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("superuser", "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("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchNothingWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -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("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace raven_integration
|
||||
D.userType = 3;//non scheduleable
|
||||
D.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -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("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace raven_integration
|
||||
D.userType = 3;//non scheduleable
|
||||
D.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -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("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInNotesId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -307,7 +307,7 @@ namespace raven_integration
|
||||
D.userType = 3;//non scheduleable
|
||||
D.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -340,7 +340,7 @@ namespace raven_integration
|
||||
|
||||
//Ensure excerpt works and contains the search phrase
|
||||
// /Search/Info/2/1?phrase=we&max=200
|
||||
a = await Util.GetAsync($"search/Info/2/{MatchWidgetInNotesId}?phrase={TEST_SEARCH_PHRASE}&max=200", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"search/Info/2/{MatchWidgetInNotesId}?phrase={TEST_SEARCH_PHRASE}&max=200", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
a.ObjectResponse["data"].Value<string>().Should().Contain(TEST_SEARCH_PHRASE.Split(" ")[0]);
|
||||
a.ObjectResponse["data"].Value<string>().Should().Contain(TEST_SEARCH_PHRASE.Split(" ")[1]);
|
||||
@@ -356,7 +356,7 @@ namespace raven_integration
|
||||
// //CREATE A TAG
|
||||
// dynamic D = new JObject();
|
||||
// D.name = Util.Uniquify("TAGSEARCH");
|
||||
// ApiResponse a = await Util.PostAsync("Tag", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
// ApiResponse a = await Util.PostAsync("Tag", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
// long TagId = 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("superuser", "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("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long NoPhraseMatchWidgetInTagId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -414,7 +414,7 @@ namespace raven_integration
|
||||
D.userType = 3;//non scheduleable
|
||||
D.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchUserInNameId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -466,7 +466,7 @@ namespace raven_integration
|
||||
|
||||
var watch = new System.Diagnostics.Stopwatch();
|
||||
watch.Start();
|
||||
ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
watch.Stop();
|
||||
|
||||
var TimeToSearch = watch.ElapsedMilliseconds;
|
||||
@@ -508,7 +508,7 @@ namespace raven_integration
|
||||
|
||||
var watch = new System.Diagnostics.Stopwatch();
|
||||
watch.Start();
|
||||
ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
watch.Stop();
|
||||
|
||||
var TimeToSearch = watch.ElapsedMilliseconds;
|
||||
@@ -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("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchWidgetInSerialId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
var MatchWidgetSerial = a.ObjectResponse["data"]["serial"].Value<uint>();
|
||||
@@ -554,7 +554,7 @@ namespace raven_integration
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -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("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long MatchingWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -631,7 +631,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Now validate the return list
|
||||
@@ -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("superuser", "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("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WidgetId = (long)a.ObjectResponse["data"]["id"];
|
||||
|
||||
@@ -682,16 +682,16 @@ Likely fix is to force order to most recent or simply to delete after test so th
|
||||
SearchParameters.phrase = TEST_SEARCH_PHRASE;
|
||||
SearchParameters.typeOnly = 0;//no type
|
||||
SearchParameters.maxResults = 0;
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
//Now validate the return list (should be only one as it's super unique)
|
||||
((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("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
|
||||
a = await Util.PostAsync("search", await Util.GetTokenAsync("superuser", "l3tm3in"), SearchParameters.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
//Now validate the return list (should be only one as it's super unique)
|
||||
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(0);
|
||||
|
||||
@@ -62,14 +62,14 @@ 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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
uint Concurrency = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
w = a.ObjectResponse["data"];
|
||||
|
||||
//validate the repository LIST ROUTE of tags contains the ones above
|
||||
a = await Util.GetAsync($"tag-list/list?query={TagNameStart}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"tag-list/list?query={TagNameStart}", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(7);
|
||||
@@ -86,29 +86,29 @@ 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("superuser", "l3tm3in"), w.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
|
||||
//Verify the tags collection remaining
|
||||
a = await Util.GetAsync($"tag-list/list?query=" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"tag-list/list?query=" + TagNameStart, await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(9);
|
||||
|
||||
//Verify the CLOUD LIST AND REF COUNT of tags collection remaining
|
||||
a = await Util.GetAsync($"tag-list/cloudlist?query=" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"tag-list/cloudlist?query=" + TagNameStart, await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(9);
|
||||
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("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
//Verify the tags collection remaining
|
||||
a = await Util.GetAsync($"tag-list/list?query=" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"tag-list/list?query=" + TagNameStart, await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(0);
|
||||
@@ -129,7 +129,7 @@ namespace raven_integration
|
||||
// d.Add(2);
|
||||
// d.Add(3);
|
||||
|
||||
ApiResponse a = await Util.PostAsync("tag-list/bulk-add/33/my new tag", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("tag-list/bulk-add/33/my new tag", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace raven_integration
|
||||
// d.Add(2);
|
||||
|
||||
|
||||
// ApiResponse a = await Util.PostAsync("tag-list/bulk-add/2/my new tag", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
// ApiResponse a = await Util.PostAsync("tag-list/bulk-add/2/my new tag", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
// //http://localhost:7575/api/v8/tag-list/bulk-add-any/2/bulk-add-this-tag
|
||||
// //http://localhost:7575/api/v8/tag-list/bulk-remove/2/happy%20new%20tag
|
||||
// //http://localhost:7575/api/v8/tag-list/bulk-remove-any/2/red
|
||||
|
||||
@@ -127,13 +127,13 @@ namespace raven_integration
|
||||
//Required by form custom rules
|
||||
DUSER.notes = "notes";
|
||||
DUSER.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), DUSER.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), DUSER.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long DUSERID = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
//RETRIEVE companion USEROPTIONS object
|
||||
ApiResponse R = await Util.GetAsync("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R = await Util.GetAsync("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("superuser", "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("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
|
||||
PUTTestResponse = await Util.PutAsync("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"), D2.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
//VALIDATE
|
||||
R = await Util.GetAsync("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
R = await Util.GetAsync("user-option/" + DUSERID.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(R);
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace raven_integration
|
||||
FirstTranslationKeyUpdated["value"].Value<string>().Should().Be(d2.newText.ToString());
|
||||
|
||||
//DELETE TEMPORARY USER SO CAN DELETE LOCALE
|
||||
a = await Util.DeleteAsync("User/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("User/" + DUSERID.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
//DELETE TEMP LOCALE
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace raven_integration
|
||||
D1.notes = "notes";
|
||||
D1.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
ApiResponse R1 = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D1.ToString());
|
||||
ApiResponse R1 = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D1.ToString());
|
||||
Util.ValidateDataReturnResponseOk(R1);
|
||||
long d1Id = R1.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace raven_integration
|
||||
|
||||
D2.userType = 3;//non scheduleable
|
||||
|
||||
ApiResponse R2 = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
|
||||
ApiResponse R2 = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D2.ToString());
|
||||
Util.ValidateDataReturnResponseOk(R2);
|
||||
long d2Id = R2.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace raven_integration
|
||||
//RETRIEVE
|
||||
|
||||
//Get one
|
||||
ApiResponse R3 = await Util.GetAsync("User/" + d2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R3 = await Util.GetAsync("User/" + d2Id.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(R3);
|
||||
R3.ObjectResponse["data"]["name"].Value<string>().Should().Be(D2.name.ToString());
|
||||
|
||||
@@ -69,17 +69,17 @@ namespace raven_integration
|
||||
D2.name = Util.Uniquify("UPDATED VIA PUT SECOND TEST User");
|
||||
D2.concurrency = R2.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
D2.id=d2Id;
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("User" , await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("User" , await Util.GetTokenAsync("superuser", "l3tm3in"), D2.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
//check PUT worked
|
||||
ApiResponse checkPUTWorked = await Util.GetAsync("User/" + d2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse checkPUTWorked = await Util.GetAsync("User/" + d2Id.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateNoErrorInResponse(checkPUTWorked);
|
||||
checkPUTWorked.ObjectResponse["data"]["name"].Value<string>().Should().Be(D2.name.ToString());
|
||||
uint concurrency = PUTTestResponse.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
|
||||
//DELETE
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("User/" + d2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("User/" + d2Id.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void UserWithActivityShouldNotBeDeleteable()
|
||||
{
|
||||
ApiResponse a = await Util.DeleteAsync("User/1", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.DeleteAsync("User/1", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
a.ObjectResponse["error"]["details"][0]["message"].Value<string>().Should().Contain("LT:ErrorDBForeignKeyViolation");
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace raven_integration
|
||||
{
|
||||
//Get non existant
|
||||
//Should return status code 404, api error code 2010
|
||||
ApiResponse R = await Util.GetAsync("User/999999", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R = await Util.GetAsync("User/999999", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateResponseNotFound(R);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,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("User/2q2", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R = await Util.GetAsync("User/2q2", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateBadModelStateResponse(R, "id");
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace raven_integration
|
||||
|
||||
D.userType = 3;//non scheduleable
|
||||
|
||||
ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateDataReturnResponseOk(R);
|
||||
long D1Id = R.ObjectResponse["data"]["id"].Value<long>();
|
||||
uint OriginalConcurrencyToken = R.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
@@ -151,7 +151,7 @@ namespace raven_integration
|
||||
D.name = Util.Uniquify("PutConcurrencyViolationShouldFail UPDATE VIA PUT ");
|
||||
D.concurrency = OriginalConcurrencyToken - 1;//bad token
|
||||
D.id=D1Id;
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D.ToString());
|
||||
Util.ValidateConcurrencyError(PUTTestResponse);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace raven_integration
|
||||
d.notes = "notes";
|
||||
d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long UserId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
uint OriginalConcurrencyToken = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
@@ -190,7 +190,7 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//GET user (login changed concurrency token above)
|
||||
a = await Util.GetAsync("User/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("User/" + UserId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
d = a.ObjectResponse["data"];
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace raven_integration
|
||||
var NewPassword = "NEW_PASSWORD";
|
||||
d.password = NewPassword;
|
||||
d.login=DCreds.login;
|
||||
a = await Util.PutAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PutAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//Test can login with new creds
|
||||
@@ -229,7 +229,7 @@ namespace raven_integration
|
||||
d.roles = 0;//norole
|
||||
d.userType = 3;//non scheduleable
|
||||
|
||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace raven_integration
|
||||
d.roles = 0;//norole
|
||||
d.userType = 3;//non scheduleable
|
||||
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
Util.ShouldContainValidationError(a, "Login", "2206");
|
||||
|
||||
@@ -28,14 +28,14 @@ namespace raven_integration
|
||||
D1.notes = "notes";
|
||||
D1.customFields = Util.UserRequiredCustomFieldsJsonString();
|
||||
|
||||
ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D1.ToString());
|
||||
ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("superuser", "l3tm3in"), D1.ToString());
|
||||
Util.ValidateDataReturnResponseOk(R);
|
||||
long UserId = R.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
//Now there should be a user options available for this user
|
||||
|
||||
//RETRIEVE companion USEROPTIONS object
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("superuser", "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("user-option/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
|
||||
ApiResponse PUTTestResponse = await Util.PutAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"), D2.ToString());
|
||||
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
|
||||
|
||||
//VALIDATE
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(R);
|
||||
//ensure the default value is set
|
||||
/*
|
||||
@@ -74,11 +74,11 @@ namespace raven_integration
|
||||
|
||||
|
||||
//DELETE USER
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("User/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("User/" + UserId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
|
||||
//CHECK DELETE USER REMOVED USEROPTIONS
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
R = await Util.GetAsync("user-option/" + UserId.ToString(), await Util.GetTokenAsync("superuser", "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("user-option/999999", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R = await Util.GetAsync("user-option/999999", await Util.GetTokenAsync("superuser", "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("user-option/2q2", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse R = await Util.GetAsync("user-option/2q2", await Util.GetTokenAsync("superuser", "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("superuser", "l3tm3in"), w1.ToString());
|
||||
Util.ValidateDataReturnResponseOk(r1);
|
||||
long w1Id = r1.ObjectResponse["data"]["id"].Value<long>();
|
||||
((long)r1.ObjectResponse["data"]["serial"]).Should().NotBe(0);
|
||||
@@ -58,14 +58,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("superuser", "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("superuser", "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());
|
||||
@@ -83,18 +83,18 @@ namespace raven_integration
|
||||
w2.id = w2Id;
|
||||
w2.serial = 123456L;
|
||||
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("superuser", "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("superuser", "l3tm3in"));
|
||||
Util.ValidateNoErrorInResponse(checkPUTWorked);
|
||||
checkPUTWorked.ObjectResponse["data"]["name"].Value<string>().Should().Be(w2.name.ToString());
|
||||
checkPUTWorked.ObjectResponse["data"]["serial"].Value<long>().Should().Be(123456L);
|
||||
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("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,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("superuser", "l3tm3in"));
|
||||
Util.ValidateResponseNotFound(a);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,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("superuser", "l3tm3in"));
|
||||
Util.ValidateBadModelStateResponse(a, "id");
|
||||
}
|
||||
|
||||
@@ -136,7 +136,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("superuser", "l3tm3in"));
|
||||
Util.ValidateServerExceptionResponse(a);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,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("superuser", "l3tm3in"));
|
||||
Util.ValidateServerExceptionResponse(a);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,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("superuser", "l3tm3in"), w2.ToString());
|
||||
Util.ValidateDataReturnResponseOk(r2);
|
||||
uint OriginalConcurrencyToken = r2.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||
w2 = r2.ObjectResponse["data"];
|
||||
@@ -185,7 +185,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("superuser", "l3tm3in"), w2.ToString());
|
||||
Util.ValidateConcurrencyError(PUTTestResponse);
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("wo-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
ApiResponse a = await Util.PostAsync("workorder", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("workorder", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic WorkorderToUpdate = a.ObjectResponse["data"];
|
||||
long WorkOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -53,7 +53,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitem-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic WorkOrderItemToUpdate = a.ObjectResponse["data"];
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitempart-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic dPartToUpdate = a.ObjectResponse["data"];
|
||||
long PartId = (long)a.ObjectResponse["data"]["id"];
|
||||
@@ -96,7 +96,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic dLaborOne = a.ObjectResponse["data"];
|
||||
long Labor1Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -115,7 +115,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItemLaborId2 = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitem-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItem2Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitempart-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//TWO-2
|
||||
@@ -197,7 +197,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("woitemlabor-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("expense-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/expenses", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/expenses", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long TestExpenseId = (long)a.ObjectResponse["data"]["id"];
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("loan-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/loans", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/loans", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("partrequest-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/partrequests", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/partrequests", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//scheduleduser
|
||||
@@ -269,7 +269,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("scheduleduser-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/scheduledusers", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/scheduledusers", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("task-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/tasks", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/tasks", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("travel-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/travels", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/travels", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace raven_integration
|
||||
dTagsArray.Add("unit-blue");
|
||||
d.tags = dTagsArray;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/units", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/units", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
#endregion create second woitem
|
||||
@@ -334,19 +334,19 @@ namespace raven_integration
|
||||
//
|
||||
|
||||
dLaborOne.notes = "UpdatedLaborNotes";
|
||||
a = await Util.PutAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), dLaborOne.ToString());
|
||||
a = await Util.PutAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), dLaborOne.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
dPartToUpdate.notes = "UpdatedPartNotes";
|
||||
a = await Util.PutAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), dPartToUpdate.ToString());
|
||||
a = await Util.PutAsync("workorder/items/parts", await Util.GetTokenAsync("superuser", "l3tm3in"), dPartToUpdate.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
WorkOrderItemToUpdate.notes = "UpdatedWoItemNotes";
|
||||
a = await Util.PutAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), WorkOrderItemToUpdate.ToString());
|
||||
a = await Util.PutAsync("workorder/items", await Util.GetTokenAsync("superuser", "l3tm3in"), WorkOrderItemToUpdate.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
WorkorderToUpdate.notes = "UpdatedWoNotes";
|
||||
a = await Util.PutAsync("workorder", await Util.GetTokenAsync("manager", "l3tm3in"), WorkorderToUpdate.ToString());
|
||||
a = await Util.PutAsync("workorder", await Util.GetTokenAsync("superuser", "l3tm3in"), WorkorderToUpdate.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
#endregion update
|
||||
@@ -354,7 +354,7 @@ namespace raven_integration
|
||||
#region Validate all create and update
|
||||
|
||||
//RETRIEVE WORKORDER AND VALIDATE ENTIRE
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
var w = a.ObjectResponse["data"];
|
||||
@@ -391,24 +391,24 @@ namespace raven_integration
|
||||
|
||||
//Test get ancestor route
|
||||
var AyaTypeWorkOrderItemExpense = 36;
|
||||
a = await Util.GetAsync($"search/ancestor/{AyaTypeWorkOrderItemExpense}/{TestExpenseId}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync($"search/ancestor/{AyaTypeWorkOrderItemExpense}/{TestExpenseId}", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
|
||||
#region DELETE
|
||||
a = await Util.DeleteAsync("workorder/items/labors/" + Labor1Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("workorder/items/labors/" + Labor1Id.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
a = await Util.GetAsync("workorder/items/labors/" + Labor1Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/items/labors/" + Labor1Id.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 404);
|
||||
|
||||
a = await Util.DeleteAsync("workorder/items/" + WorkOrderItem2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("workorder/items/" + WorkOrderItem2Id.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
a = await Util.GetAsync("workorder/items/" + WorkOrderItem2Id.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/items/" + WorkOrderItem2Id.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 404);
|
||||
|
||||
a = await Util.DeleteAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateHTTPStatusCode(a, 404);
|
||||
|
||||
#endregion delete
|
||||
@@ -420,7 +420,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async void ConfirmDeleteTransactionWorksAtServer()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
var BuildMode = (string)a.ObjectResponse["data"]["buildMode"];
|
||||
|
||||
@@ -432,7 +432,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("workorder", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -440,7 +440,7 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderId = WorkOrderId;
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItem1Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -448,7 +448,7 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//CREATE TWO WOITEMLABORS
|
||||
@@ -456,21 +456,21 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//TWO
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//CREATE WOITEM-2
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderId = WorkOrderId;
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItem2Id = (long)a.ObjectResponse["data"]["id"];
|
||||
|
||||
@@ -478,7 +478,7 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//CREATE WOITEMLABOR(S)-2
|
||||
@@ -486,22 +486,22 @@ namespace raven_integration
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//TWO-2
|
||||
d = new JObject();
|
||||
d.active = true;
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
a = await Util.DeleteAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.DeleteAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||
|
||||
//now confirm the workorder is still there and with it's children intact
|
||||
//RETRIEVE WORKORDER AND VALIDATE ENTIRE
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
var w = a.ObjectResponse["data"];
|
||||
@@ -537,7 +537,7 @@ namespace raven_integration
|
||||
d.notes = "WOHEADER DuplicateWorks";
|
||||
d.wiki = "DuplicateWorks integration test";
|
||||
|
||||
ApiResponse a = await Util.PostAsync("workorder", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
ApiResponse a = await Util.PostAsync("workorder", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic WorkorderToUpdate = a.ObjectResponse["data"];
|
||||
long WorkOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -551,7 +551,7 @@ namespace raven_integration
|
||||
d.wiki = "# woitem test wiki";
|
||||
d.workOrderId = WorkOrderId;
|
||||
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic WorkOrderItemToUpdate = a.ObjectResponse["data"];
|
||||
long WorkOrderItem1Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -563,7 +563,7 @@ namespace raven_integration
|
||||
// d.wiki = "# woitempart test wiki";
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic dPartToUpdate = a.ObjectResponse["data"];
|
||||
long PartId = (long)a.ObjectResponse["data"]["id"];
|
||||
@@ -577,7 +577,7 @@ namespace raven_integration
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
|
||||
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
dynamic dLaborOne = a.ObjectResponse["data"];
|
||||
long Labor1Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
@@ -590,7 +590,7 @@ namespace raven_integration
|
||||
d.workOrderItemId = WorkOrderItem1Id;
|
||||
|
||||
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItemLaborId2 = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -607,7 +607,7 @@ namespace raven_integration
|
||||
d.wiki = "# woitem test wiki";
|
||||
d.workOrderId = WorkOrderId;
|
||||
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long WorkOrderItem2Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
@@ -618,7 +618,7 @@ namespace raven_integration
|
||||
// d.wiki = "# woitempart test wiki";
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/parts", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//CREATE WOITEMLABOR(S)-2
|
||||
@@ -628,7 +628,7 @@ namespace raven_integration
|
||||
d.notes = "woitem-2-laborDuplicateWorks";
|
||||
//d.wiki = "# woitemlabor test wiki";
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
//TWO-2
|
||||
@@ -637,7 +637,7 @@ namespace raven_integration
|
||||
d.notes = "woitem-2-labor2DuplicateWorks";
|
||||
//d.wiki = "# woitemlabor2 test wiki";
|
||||
d.workOrderItemId = WorkOrderItem2Id;
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/items/labors", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
#endregion create second woitem
|
||||
@@ -647,14 +647,14 @@ 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("workorder/duplicate/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||
a = await Util.PostAsync("workorder/duplicate/" + WorkOrderId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
long DuplicateWorkOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
DuplicateWorkOrderId.Should().NotBe(WorkOrderId);
|
||||
((long)a.ObjectResponse["data"]["serial"]).Should().NotBe(0);
|
||||
|
||||
// //RETRIEVE WORKORDER AND VALIDATE ENTIRE
|
||||
// a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
// a = await Util.GetAsync("workorder/" + WorkOrderId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||
// Util.ValidateDataReturnResponseOk(a);
|
||||
|
||||
var w = a.ObjectResponse["data"];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@SET /a VAR=500
|
||||
@SET /a VAR=1000
|
||||
ECHO Start burntest %VAR% runs at %Time% >> burntesttimer.txt
|
||||
:HOME
|
||||
@SET /a VAR=VAR-1
|
||||
|
||||
@@ -49,3 +49,11 @@ Start burntest 500 runs at 17:45:26.99
|
||||
Stop burntest 21:29:02.79
|
||||
Start burntest 500 runs at 15:46:36.85
|
||||
Start burntest 500 runs at 16:06:42.04
|
||||
Start burntest 500 runs at 16:34:11.94
|
||||
Start burntest 500 runs at 16:41:46.18
|
||||
Start burntest 500 runs at 7:05:12.93
|
||||
Start burntest 5000 runs at 17:30:00.84
|
||||
Start burntest 5000 runs at 14:08:00.31
|
||||
Start burntest 5000 runs at 12:29:09.69
|
||||
Start burntest 5000 runs at 14:55:54.51
|
||||
Start burntest 1000 runs at 14:56:14.50
|
||||
|
||||
6
info.txt
6
info.txt
@@ -1,4 +1,8 @@
|
||||
|
||||
How to fix duplicated tests
|
||||
|
||||
https://github.com/formulahendry/vscode-dotnet-test-explorer/issues/159#issuecomment-481957291
|
||||
https://github.com/formulahendry/vscode-dotnet-test-explorer/issues/159#issuecomment-481957291
|
||||
|
||||
|
||||
|
||||
Test commit to new svn server
|
||||
@@ -7,12 +7,10 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentAssertions" Version="5.9.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="5.10.3" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
<!-- <PackageReference Include="coverlet.collector" Version="1.0.1" /> -->
|
||||
<!-- <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" /> -->
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
2
util.cs
2
util.cs
@@ -29,7 +29,7 @@ namespace raven_integration
|
||||
{
|
||||
//#######################################################################################################
|
||||
public static string API_BASE_URL = "http://localhost:7575/api/v8/";
|
||||
// public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
// public static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
|
||||
|
||||
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";
|
||||
//#######################################################################################################
|
||||
|
||||
Reference in New Issue
Block a user