This commit is contained in:
2020-05-13 23:22:09 +00:00
parent d8ab0420c0
commit 9716e67909
5 changed files with 49 additions and 49 deletions

View File

@@ -45,7 +45,7 @@ namespace raven_integration
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>(); var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
if (BuildMode == "DEBUG") if (BuildMode == "DEBUG")
{ {
a = await Util.GetAsync("Translation/List", await Util.GetTokenAsync("INTEGRATION_TEST", "EXPIRED"));//lowest level test user because there are no limits on this route except to be authenticated a = await Util.GetAsync("Translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "EXPIRED"));//lowest level test user because there are no limits on this route except to be authenticated
Util.ValidateHTTPStatusCode(a, 401); Util.ValidateHTTPStatusCode(a, 401);
} }
} }
@@ -60,7 +60,7 @@ namespace raven_integration
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>(); var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
if (BuildMode == "DEBUG") if (BuildMode == "DEBUG")
{ {
a = await Util.GetAsync("Translation/List", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_ISSUER"));//lowest level test user because there are no limits on this route except to be authenticated a = await Util.GetAsync("Translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_ISSUER"));//lowest level test user because there are no limits on this route except to be authenticated
Util.ValidateHTTPStatusCode(a, 401); Util.ValidateHTTPStatusCode(a, 401);
} }
} }
@@ -75,7 +75,7 @@ namespace raven_integration
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>(); var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
if (BuildMode == "DEBUG") if (BuildMode == "DEBUG")
{ {
a = await Util.GetAsync("Translation/List", await Util.GetTokenAsync("INTEGRATION_TEST", "NO_ALGORITHM")); a = await Util.GetAsync("Translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "NO_ALGORITHM"));
Util.ValidateHTTPStatusCode(a, 401); Util.ValidateHTTPStatusCode(a, 401);
} }
} }
@@ -90,7 +90,7 @@ namespace raven_integration
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>(); var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
if (BuildMode == "DEBUG") if (BuildMode == "DEBUG")
{ {
a = await Util.GetAsync("Translation/List", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_SECRET")); a = await Util.GetAsync("Translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_SECRET"));
Util.ValidateHTTPStatusCode(a, 401); Util.ValidateHTTPStatusCode(a, 401);
} }
} }
@@ -106,7 +106,7 @@ namespace raven_integration
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>(); var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
if (BuildMode == "DEBUG") if (BuildMode == "DEBUG")
{ {
a = await Util.GetAsync("Translation/List", await Util.GetTokenAsync("INTEGRATION_TEST", "TRUNCATED_SIGNATURE")); a = await Util.GetAsync("Translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "TRUNCATED_SIGNATURE"));
Util.ValidateHTTPStatusCode(a, 401); Util.ValidateHTTPStatusCode(a, 401);
} }
} }
@@ -122,7 +122,7 @@ namespace raven_integration
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>(); var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
if (BuildMode == "DEBUG") if (BuildMode == "DEBUG")
{ {
a = await Util.GetAsync("Translation/List", await Util.GetTokenAsync("INTEGRATION_TEST", "TRANSPOSE_SIGNATURE")); a = await Util.GetAsync("Translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "TRANSPOSE_SIGNATURE"));
Util.ValidateHTTPStatusCode(a, 401); Util.ValidateHTTPStatusCode(a, 401);
} }
} }

View File

@@ -10,7 +10,7 @@ namespace raven_integration
public class PickListAllTests public class PickListAllTests
{ {
//NOTE: in order not to interfere in each other will use Widget picklist to test with standard unmodified picklist template //NOTE: in order not to interfere in each other will use Widget picklist to test with standard unmodified picklist template
//and will use User PickList to test the template functionality //and will use User pick-list to test the template functionality
/// <summary> /// <summary>
/// Test all Template editing related routes /// Test all Template editing related routes
@@ -33,13 +33,13 @@ namespace raven_integration
d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None); d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
//replace the User template at the server //replace the User template at the server
ApiResponse a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None)); ApiResponse a = await Util.PostAsync("pick-list/template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
Util.ValidateHTTPStatusCode(a, 204); Util.ValidateHTTPStatusCode(a, 204);
//RETRIEVE //RETRIEVE
//Get one //Get one
a = await Util.GetAsync("PickList/Template/3/", await Util.GetTokenAsync("BizAdminFull")); a = await Util.GetAsync("pick-list/template/3/", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//assert contains ONE record ONLY and it's the one we set //assert contains ONE record ONLY and it's the one we set
var templateArray = JArray.Parse(a.ObjectResponse["data"]["template"].Value<string>()); var templateArray = JArray.Parse(a.ObjectResponse["data"]["template"].Value<string>());
@@ -85,7 +85,7 @@ namespace raven_integration
//GET PICKLIST FOR unique phrase query sb only employee number due to custom template //GET PICKLIST FOR unique phrase query sb only employee number due to custom template
a = await Util.GetAsync("PickList/List?ayaType=3&query=" + UniquePhrase, await Util.GetTokenAsync("BizAdminFull")); a = await Util.GetAsync("pick-list/list?ayaType=3&query=" + UniquePhrase, await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
var pickList = ((JArray)a.ObjectResponse["data"]); var pickList = ((JArray)a.ObjectResponse["data"]);
pickList.Count.Should().Be(1); pickList.Count.Should().Be(1);
@@ -101,11 +101,11 @@ namespace raven_integration
d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None); d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
//replace the User template at the server //replace the User template at the server
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None)); a = await Util.PostAsync("pick-list/template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
Util.ValidateHTTPStatusCode(a, 204); Util.ValidateHTTPStatusCode(a, 204);
//GET PICKLIST FOR unique phrase query sb only user name field due to custom template //GET PICKLIST FOR unique phrase query sb only user name field due to custom template
a = await Util.GetAsync("PickList/List?ayaType=3&query=" + UniquePhrase, await Util.GetTokenAsync("BizAdminFull")); a = await Util.GetAsync("pick-list/list?ayaType=3&query=" + UniquePhrase, await Util.GetTokenAsync("BizAdminFull"));
//"select auser.id as plId, auser.active as plActive, concat_ws(' ', auser.name) as plname from auser where auser.active = true and ((auser.name like '%pick1584556347748%')) order by auser.name limit 100" //"select auser.id as plId, auser.active as plActive, concat_ws(' ', auser.name) as plname from auser where auser.active = true and ((auser.name like '%pick1584556347748%')) order by auser.name limit 100"
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
pickList = ((JArray)a.ObjectResponse["data"]); pickList = ((JArray)a.ObjectResponse["data"]);
@@ -121,12 +121,12 @@ namespace raven_integration
// RESET TEMPLATE TO DEFAULT // RESET TEMPLATE TO DEFAULT
a = await Util.DeleteAsync("PickList/Template/3/", await Util.GetTokenAsync("BizAdminFull")); a = await Util.DeleteAsync("pick-list/template/3/", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateHTTPStatusCode(a, 204); Util.ValidateHTTPStatusCode(a, 204);
//RETRIEVE (Confirm it's back to default) //RETRIEVE (Confirm it's back to default)
//Get one //Get one
a = await Util.GetAsync("PickList/Template/3/", await Util.GetTokenAsync("BizAdminFull")); a = await Util.GetAsync("pick-list/template/3/", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//assert contains default template record ONLY and it's the one we set //assert contains default template record ONLY and it's the one we set
templateArray = JArray.Parse(a.ObjectResponse["data"]["template"].Value<string>()); templateArray = JArray.Parse(a.ObjectResponse["data"]["template"].Value<string>());
@@ -144,7 +144,7 @@ namespace raven_integration
df.fld = "DOES_NOT_EXIST";//<-- ERROR BAD FIELD NAME df.fld = "DOES_NOT_EXIST";//<-- ERROR BAD FIELD NAME
dTemplateArray.Add(df); dTemplateArray.Add(df);
d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None); d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None)); a = await Util.PostAsync("pick-list/template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
//"{\"error\":{\"code\":\"2200\",\"details\":[{\"message\":\"Template array item 0, fld property value \\\"DOES_NOT_EXIST\\\" is not a valid value for AyaType specified\",\"target\":\"Template\",\"error\":\"2203\"}],\"message\":\"Object did not pass validation\"}}" //"{\"error\":{\"code\":\"2200\",\"details\":[{\"message\":\"Template array item 0, fld property value \\\"DOES_NOT_EXIST\\\" is not a valid value for AyaType specified\",\"target\":\"Template\",\"error\":\"2203\"}],\"message\":\"Object did not pass validation\"}}"
Util.ValidateErrorCodeResponse(a, 2200, 400); Util.ValidateErrorCodeResponse(a, 2200, 400);
Util.ShouldContainValidationError(a, "Template", "2203"); Util.ShouldContainValidationError(a, "Template", "2203");
@@ -159,7 +159,7 @@ namespace raven_integration
dTemplateArray.Add(df); dTemplateArray.Add(df);
d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None); d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
//replace the User template at the server //replace the User template at the server
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None)); a = await Util.PostAsync("pick-list/template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
//"{\"error\":{\"code\":\"2200\",\"details\":[{\"message\":\"Template array item 0, fld property value \\\"DOES_NOT_EXIST\\\" is not a valid value for AyaType specified\",\"target\":\"Template\",\"error\":\"2203\"}],\"message\":\"Object did not pass validation\"}}" //"{\"error\":{\"code\":\"2200\",\"details\":[{\"message\":\"Template array item 0, fld property value \\\"DOES_NOT_EXIST\\\" is not a valid value for AyaType specified\",\"target\":\"Template\",\"error\":\"2203\"}],\"message\":\"Object did not pass validation\"}}"
Util.ValidateErrorCodeResponse(a, 2200, 400); Util.ValidateErrorCodeResponse(a, 2200, 400);
Util.ShouldContainValidationError(a, "ayaType", "2203"); Util.ShouldContainValidationError(a, "ayaType", "2203");
@@ -175,7 +175,7 @@ namespace raven_integration
dTemplateArray.Add(df); dTemplateArray.Add(df);
d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None); d.Template = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
//ERROR NO RIGHTS USER //ERROR NO RIGHTS USER
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("CustomerLimited"), d.ToString(Newtonsoft.Json.Formatting.None)); a = await Util.PostAsync("pick-list/template", await Util.GetTokenAsync("CustomerLimited"), d.ToString(Newtonsoft.Json.Formatting.None));
//"{\"error\":{\"code\":\"2004\",\"message\":\"User not authorized for this resource operation (insufficient rights)\"}}" //"{\"error\":{\"code\":\"2004\",\"message\":\"User not authorized for this resource operation (insufficient rights)\"}}"
Util.ValidateErrorCodeResponse(a, 2004, 403); Util.ValidateErrorCodeResponse(a, 2004, 403);
@@ -183,7 +183,7 @@ namespace raven_integration
d = new JObject(); d = new JObject();
d.Id = 3;//User d.Id = 3;//User
d.Template = "";//<-- ERROR no template d.Template = "";//<-- ERROR no template
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None)); a = await Util.PostAsync("pick-list/template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
Util.ValidateErrorCodeResponse(a, 2200, 400); Util.ValidateErrorCodeResponse(a, 2200, 400);
Util.ShouldContainValidationError(a, "Template", "2201"); Util.ShouldContainValidationError(a, "Template", "2201");
@@ -197,7 +197,7 @@ namespace raven_integration
dTemplateArray.Add(df); dTemplateArray.Add(df);
string sTemplate = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None); string sTemplate = dTemplateArray.ToString(Newtonsoft.Json.Formatting.None);
d.Template = sTemplate.Substring(2);//<-- ERROR missing first two characters of json template array d.Template = sTemplate.Substring(2);//<-- ERROR missing first two characters of json template array
a = await Util.PostAsync("PickList/Template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None)); a = await Util.PostAsync("pick-list/template", await Util.GetTokenAsync("BizAdminFull"), d.ToString(Newtonsoft.Json.Formatting.None));
//"{\"error\":{\"code\":\"2200\",\"details\":[{\"message\":\"Template is not valid JSON string: Error reading JArray from JsonReader. Current JsonReader item is not an array: String. Path '', line 1, position 5.\",\"target\":\"Template\",\"error\":\"2203\"}],\"message\":\"Object did not pass validation\"}}" //"{\"error\":{\"code\":\"2200\",\"details\":[{\"message\":\"Template is not valid JSON string: Error reading JArray from JsonReader. Current JsonReader item is not an array: String. Path '', line 1, position 5.\",\"target\":\"Template\",\"error\":\"2203\"}],\"message\":\"Object did not pass validation\"}}"
Util.ValidateErrorCodeResponse(a, 2200, 400); Util.ValidateErrorCodeResponse(a, 2200, 400);
Util.ShouldContainValidationError(a, "Template", "2203"); Util.ShouldContainValidationError(a, "Template", "2203");
@@ -211,7 +211,7 @@ namespace raven_integration
public async void PickListTemplateList() public async void PickListTemplateList()
{ {
//RETRIEVE //RETRIEVE
ApiResponse a = await Util.GetAsync("PickList/Template/List", await Util.GetTokenAsync("BizAdminFull")); ApiResponse a = await Util.GetAsync("pick-list/template/list", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//assert contains at least two records (as we only have two at time of writing this test) //assert contains at least two records (as we only have two at time of writing this test)
var templateList = ((JArray)a.ObjectResponse["data"]); var templateList = ((JArray)a.ObjectResponse["data"]);
@@ -227,7 +227,7 @@ namespace raven_integration
public async void WidgetPickListTemplateFieldList() public async void WidgetPickListTemplateFieldList()
{ {
//RETRIEVE WIDGET PICKLIST FIELDS //RETRIEVE WIDGET PICKLIST FIELDS
ApiResponse a = await Util.GetAsync("PickList/Template/ListFields/2", await Util.GetTokenAsync("BizAdminFull")); ApiResponse a = await Util.GetAsync("pick-list/template/ListFields/2", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//assert contains at least two records (as we only have two at time of writing this test) //assert contains at least two records (as we only have two at time of writing this test)
var templateList = ((JArray)a.ObjectResponse["data"]); var templateList = ((JArray)a.ObjectResponse["data"]);
@@ -243,7 +243,7 @@ namespace raven_integration
public async void FetchWidgetPickListNoQuery() public async void FetchWidgetPickListNoQuery()
{ {
//RETRIEVE WIDGET PICKLIST no filter //RETRIEVE WIDGET PICKLIST no filter
ApiResponse a = await Util.GetAsync("PickList/List?ayaType=2", await Util.GetTokenAsync("BizAdminFull")); ApiResponse a = await Util.GetAsync("pick-list/list?ayaType=2", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//assert contains 100 records (current picklist maximum count) //assert contains 100 records (current picklist maximum count)
var pickList = ((JArray)a.ObjectResponse["data"]); var pickList = ((JArray)a.ObjectResponse["data"]);
@@ -258,7 +258,7 @@ namespace raven_integration
public async void FetchWidgetPickListPreDefined() public async void FetchWidgetPickListPreDefined()
{ {
//fetch the manager account which always exists //fetch the manager account which always exists
ApiResponse a = await Util.GetAsync("PickList/List?ayaType=3&preId=1", await Util.GetTokenAsync("BizAdminFull")); ApiResponse a = await Util.GetAsync("pick-list/list?ayaType=3&preId=1", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//assert contains 1 record //assert contains 1 record
var pickList = ((JArray)a.ObjectResponse["data"]); var pickList = ((JArray)a.ObjectResponse["data"]);
@@ -295,7 +295,7 @@ namespace raven_integration
//RETRIEVE WIDGET PICKLIST with name filter //RETRIEVE WIDGET PICKLIST with name filter
a = await Util.GetAsync("PickList/List?ayaType=2&query=a1b2c3", await Util.GetTokenAsync("BizAdminFull")); a = await Util.GetAsync("pick-list/list?ayaType=2&query=a1b2c3", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
var pickList = ((JArray)a.ObjectResponse["data"]); var pickList = ((JArray)a.ObjectResponse["data"]);
@@ -339,7 +339,7 @@ namespace raven_integration
//RETRIEVE WIDGET PICKLIST with name filter //RETRIEVE WIDGET PICKLIST with name filter
a = await Util.GetAsync("PickList/List?ayaType=2&query=..lblu", await Util.GetTokenAsync("BizAdminFull")); a = await Util.GetAsync("pick-list/list?ayaType=2&query=..lblu", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
var pickList = ((JArray)a.ObjectResponse["data"]); var pickList = ((JArray)a.ObjectResponse["data"]);
@@ -406,7 +406,7 @@ namespace raven_integration
//CONFIRM BOTH INACTIVE AND ACTIVE //CONFIRM BOTH INACTIVE AND ACTIVE
a = await Util.GetAsync("PickList/List?ayaType=2&query=ickListInactiveAct&inactive=true", await Util.GetTokenAsync("BizAdminFull")); a = await Util.GetAsync("pick-list/list?ayaType=2&query=ickListInactiveAct&inactive=true", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
var pickList = ((JArray)a.ObjectResponse["data"]); var pickList = ((JArray)a.ObjectResponse["data"]);
//assert contains at least two records //assert contains at least two records
@@ -425,7 +425,7 @@ namespace raven_integration
//CONFIRM ACTIVE ONLY //CONFIRM ACTIVE ONLY
a = await Util.GetAsync("PickList/List?ayaType=2&query=ickListInactiveAct", await Util.GetTokenAsync("BizAdminFull")); a = await Util.GetAsync("pick-list/list?ayaType=2&query=ickListInactiveAct", await Util.GetTokenAsync("BizAdminFull"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
pickList = ((JArray)a.ObjectResponse["data"]); pickList = ((JArray)a.ObjectResponse["data"]);
//assert contains at least two records //assert contains at least two records

View File

@@ -19,7 +19,7 @@ namespace raven_integration
//CREATE A WIDGET //CREATE A WIDGET
dynamic D = new JObject(); dynamic D = new JObject();
D.name = Util.Uniquify("Search NOTES Test WIDGET"); D.name = Util.Uniquify("search NOTES Test WIDGET");
D.customFields = Util.WidgetRequiredCustomFieldsJsonString(); D.customFields = Util.WidgetRequiredCustomFieldsJsonString();
D.dollarAmount = 1.11m; D.dollarAmount = 1.11m;
D.active = true; D.active = true;
@@ -32,7 +32,7 @@ namespace raven_integration
//CREATE FIRST TEST USER WITH PHRASE IN NAME //CREATE FIRST TEST USER WITH PHRASE IN NAME
D = new JObject(); D = new JObject();
D.name = Util.Uniquify("Search NAME DOGS simple Test User"); D.name = Util.Uniquify("search NAME DOGS simple Test User");
D.customFields = Util.WidgetRequiredCustomFieldsJsonString(); D.customFields = Util.WidgetRequiredCustomFieldsJsonString();
D.notes = "This user has the match in it's name"; D.notes = "This user has the match in it's name";
@@ -49,7 +49,7 @@ namespace raven_integration
//CREATE A SECOND TEST USER WITH PHRASE IN NOTES //CREATE A SECOND TEST USER WITH PHRASE IN NOTES
D = new JObject(); D = new JObject();
D.name = Util.Uniquify("Search NOTES Test User"); D.name = Util.Uniquify("search NOTES Test User");
D.customFields = Util.WidgetRequiredCustomFieldsJsonString(); D.customFields = Util.WidgetRequiredCustomFieldsJsonString();
D.notes = "This user has the match simple dogs in its notes"; D.notes = "This user has the match simple dogs in its notes";
@@ -66,7 +66,7 @@ namespace raven_integration
//CREATE A SECOND WIDGET //CREATE A SECOND WIDGET
D = new JObject(); D = new JObject();
D.name = Util.Uniquify("Search NAME simple as in dogs Test WIDGET"); D.name = Util.Uniquify("search NAME simple as in dogs Test WIDGET");
D.customFields = Util.WidgetRequiredCustomFieldsJsonString(); D.customFields = Util.WidgetRequiredCustomFieldsJsonString();
D.dollarAmount = 1.11m; D.dollarAmount = 1.11m;
D.active = true; D.active = true;
@@ -79,7 +79,7 @@ namespace raven_integration
//CREATE A THIRD WIDGET //CREATE A THIRD WIDGET
D = new JObject(); D = new JObject();
D.name = Util.Uniquify("Search NO-MATCH THIRD Test WIDGET"); D.name = Util.Uniquify("search NO-MATCH THIRD Test WIDGET");
D.customFields = Util.WidgetRequiredCustomFieldsJsonString(); D.customFields = Util.WidgetRequiredCustomFieldsJsonString();
D.dollarAmount = 1.11m; D.dollarAmount = 1.11m;
D.active = true; D.active = true;
@@ -98,7 +98,7 @@ namespace raven_integration
SearchParameters.typeOnly = 0;//no type SearchParameters.typeOnly = 0;//no type
SearchParameters.maxResults = 0; SearchParameters.maxResults = 0;
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list //Now validate the return list
@@ -134,7 +134,7 @@ namespace raven_integration
//Only BizAdmin* roles can read a full user record //Only BizAdmin* roles can read a full user record
//This search should return zero items //This search should return zero items
a = await Util.PostAsync("Search", await Util.GetTokenAsync("SubContractorLimited"), SearchParameters.ToString()); a = await Util.PostAsync("search", await Util.GetTokenAsync("SubContractorLimited"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(0, "User with no rights should not see any results in body search"); ((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(0, "User with no rights should not see any results in body search");
@@ -189,7 +189,7 @@ namespace raven_integration
SearchParameters.typeOnly = 0;//no type SearchParameters.typeOnly = 0;//no type
SearchParameters.maxResults = 0; SearchParameters.maxResults = 0;
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list //Now validate the return list
@@ -253,7 +253,7 @@ namespace raven_integration
SearchParameters.typeOnly = 0;//no type SearchParameters.typeOnly = 0;//no type
SearchParameters.maxResults = 0; SearchParameters.maxResults = 0;
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list //Now validate the return list
@@ -319,7 +319,7 @@ namespace raven_integration
SearchParameters.typeOnly = 0;//no type SearchParameters.typeOnly = 0;//no type
SearchParameters.maxResults = 0; SearchParameters.maxResults = 0;
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list //Now validate the return list
@@ -340,7 +340,7 @@ namespace raven_integration
//Ensure excerpt works and contains the search phrase //Ensure excerpt works and contains the search phrase
// /Search/Info/2/1?phrase=we&max=200 // /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("manager", "l3tm3in"));
Util.ValidateDataReturnResponseOk(a); 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(" ")[0]);
a.ObjectResponse["data"].Value<string>().Should().Contain(TEST_SEARCH_PHRASE.Split(" ")[1]); a.ObjectResponse["data"].Value<string>().Should().Contain(TEST_SEARCH_PHRASE.Split(" ")[1]);
@@ -426,7 +426,7 @@ namespace raven_integration
SearchParameters.typeOnly = 0;//no type 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("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list //Now validate the return list
@@ -466,7 +466,7 @@ namespace raven_integration
var watch = new System.Diagnostics.Stopwatch(); var watch = new System.Diagnostics.Stopwatch();
watch.Start(); watch.Start();
ApiResponse a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
watch.Stop(); watch.Stop();
var TimeToSearch = watch.ElapsedMilliseconds; var TimeToSearch = watch.ElapsedMilliseconds;
@@ -508,7 +508,7 @@ namespace raven_integration
var watch = new System.Diagnostics.Stopwatch(); var watch = new System.Diagnostics.Stopwatch();
watch.Start(); watch.Start();
ApiResponse a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); ApiResponse a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
watch.Stop(); watch.Stop();
var TimeToSearch = watch.ElapsedMilliseconds; var TimeToSearch = watch.ElapsedMilliseconds;
@@ -554,7 +554,7 @@ namespace raven_integration
SearchParameters.typeOnly = 0;//no type SearchParameters.typeOnly = 0;//no type
SearchParameters.maxResults = 0; SearchParameters.maxResults = 0;
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list //Now validate the return list
@@ -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 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("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list //Now validate the return list
@@ -682,7 +682,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
SearchParameters.phrase = TEST_SEARCH_PHRASE; SearchParameters.phrase = TEST_SEARCH_PHRASE;
SearchParameters.typeOnly = 0;//no type SearchParameters.typeOnly = 0;//no type
SearchParameters.maxResults = 0; SearchParameters.maxResults = 0;
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list (should be only one as it's super unique) //Now validate the return list (should be only one as it's super unique)
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(1); ((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(1);
@@ -691,7 +691,7 @@ Likely fix is to force order to most recent or simply to delete after test so th
a = await Util.DeleteAsync("Widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in")); a = await Util.DeleteAsync("Widget/" + WidgetId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
Util.ValidateHTTPStatusCode(a, 204); Util.ValidateHTTPStatusCode(a, 204);
a = await Util.PostAsync("Search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString()); a = await Util.PostAsync("search", await Util.GetTokenAsync("manager", "l3tm3in"), SearchParameters.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
//Now validate the return list (should be only one as it's super unique) //Now validate the return list (should be only one as it's super unique)
((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(0); ((JArray)a.ObjectResponse["data"]["searchResults"]).Count.Should().Be(0);

View File

@@ -69,7 +69,7 @@ namespace raven_integration
w = a.ObjectResponse["data"]; w = a.ObjectResponse["data"];
//validate the repository LIST ROUTE of tags contains the ones above //validate the repository LIST ROUTE of tags contains the ones above
a = await Util.GetAsync($"TagList/List?query={TagNameStart}", await Util.GetTokenAsync("manager", "l3tm3in")); a = await Util.GetAsync($"TagList/list?query={TagNameStart}", await Util.GetTokenAsync("manager", "l3tm3in"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200); Util.ValidateHTTPStatusCode(a, 200);
((JArray)a.ObjectResponse["data"]).Count.Should().Be(7); ((JArray)a.ObjectResponse["data"]).Count.Should().Be(7);
@@ -91,7 +91,7 @@ namespace raven_integration
//Verify the tags collection remaining //Verify the tags collection remaining
a = await Util.GetAsync($"TagList/List?query=" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in")); a = await Util.GetAsync($"TagList/list?query=" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200); Util.ValidateHTTPStatusCode(a, 200);
((JArray)a.ObjectResponse["data"]).Count.Should().Be(9); ((JArray)a.ObjectResponse["data"]).Count.Should().Be(9);
@@ -108,7 +108,7 @@ namespace raven_integration
Util.ValidateHTTPStatusCode(DELETETestResponse, 204); Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
//Verify the tags collection remaining //Verify the tags collection remaining
a = await Util.GetAsync($"TagList/List?query=" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in")); a = await Util.GetAsync($"TagList/list?query=" + TagNameStart, await Util.GetTokenAsync("manager", "l3tm3in"));
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200); Util.ValidateHTTPStatusCode(a, 200);
((JArray)a.ObjectResponse["data"]).Count.Should().Be(0); ((JArray)a.ObjectResponse["data"]).Count.Should().Be(0);

View File

@@ -23,7 +23,7 @@ namespace raven_integration
public async void TranslationListWorks() public async void TranslationListWorks()
{ {
//Get all //Get all
ApiResponse a = await Util.GetAsync("Translation/List", await Util.GetTokenAsync("CustomerLimited"));//lowest level test user because there are no limits on this route except to be authenticated ApiResponse a = await Util.GetAsync("Translation/list", await Util.GetTokenAsync("CustomerLimited"));//lowest level test user because there are no limits on this route except to be authenticated
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
Util.ValidateHTTPStatusCode(a, 200); Util.ValidateHTTPStatusCode(a, 200);
//there should be at least 4 of them as there are 4 stock translations //there should be at least 4 of them as there are 4 stock translations