This commit is contained in:
2019-07-02 18:57:40 +00:00
parent d297e27496
commit 077f8bf9f0
4 changed files with 79 additions and 16 deletions

View File

@@ -147,6 +147,9 @@ namespace raven_integration
DUSER.roles = 0;//norole (any role can get a subset of locale keys) DUSER.roles = 0;//norole (any role can get a subset of locale keys)
DUSER.localeId = NewId;//random locale DUSER.localeId = NewId;//random locale
DUSER.userType = 3;//non scheduleable DUSER.userType = 3;//non scheduleable
//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("manager", "l3tm3in"), DUSER.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
long DUSERID = a.ObjectResponse["data"]["id"].Value<long>(); long DUSERID = a.ObjectResponse["data"]["id"].Value<long>();

View File

@@ -27,6 +27,10 @@ namespace raven_integration
D1.localeId = 1;//random locale D1.localeId = 1;//random locale
D1.userType = 3;//non scheduleable D1.userType = 3;//non scheduleable
//Required by form custom rules
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("manager", "l3tm3in"), D1.ToString());
Util.ValidateDataReturnResponseOk(R1); Util.ValidateDataReturnResponseOk(R1);
long d1Id = R1.ObjectResponse["data"]["id"].Value<long>(); long d1Id = R1.ObjectResponse["data"]["id"].Value<long>();
@@ -34,7 +38,9 @@ namespace raven_integration
dynamic D2 = new JObject(); dynamic D2 = new JObject();
D2.name = Util.Uniquify("Second Test User"); D2.name = Util.Uniquify("Second Test User");
//Required by form custom rules
D2.notes = "notes";
D2.customFields = Util.UserRequiredCustomFieldsJsonString();
D2.active = true; D2.active = true;
D2.login = Util.Uniquify("LOGIN"); D2.login = Util.Uniquify("LOGIN");
D2.password = Util.Uniquify("PASSWORD"); D2.password = Util.Uniquify("PASSWORD");
@@ -134,7 +140,8 @@ namespace raven_integration
//CREATE //CREATE
dynamic D = new JObject(); dynamic D = new JObject();
D.name = Util.Uniquify("PutConcurrencyViolationShouldFail"); D.name = Util.Uniquify("PutConcurrencyViolationShouldFail");
D.notes = "notes";
D.customFields = Util.UserRequiredCustomFieldsJsonString();
D.active = true; D.active = true;
D.login = Util.Uniquify("LOGIN"); D.login = Util.Uniquify("LOGIN");
D.password = Util.Uniquify("PASSWORD"); D.password = Util.Uniquify("PASSWORD");
@@ -174,6 +181,10 @@ namespace raven_integration
D.roles = 0;//norole D.roles = 0;//norole
D.localeId = 1;//random locale D.localeId = 1;//random locale
D.userType = 3;//non scheduleable D.userType = 3;//non scheduleable
//Required by form custom rules
D.notes = "notes";
D.customFields = Util.UserRequiredCustomFieldsJsonString();
ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString()); ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
Util.ValidateDataReturnResponseOk(R); Util.ValidateDataReturnResponseOk(R);
@@ -207,6 +218,10 @@ namespace raven_integration
D.localeId = 1;//random locale D.localeId = 1;//random locale
D.userType = 3;//non scheduleable D.userType = 3;//non scheduleable
//Required by form custom rules
D.notes = "notes";
D.customFields = Util.UserRequiredCustomFieldsJsonString();
ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString()); ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
Util.ValidateDataReturnResponseOk(R); Util.ValidateDataReturnResponseOk(R);
long w2Id = R.ObjectResponse["data"]["id"].Value<long>(); long w2Id = R.ObjectResponse["data"]["id"].Value<long>();
@@ -247,6 +262,9 @@ namespace raven_integration
D.roles = 0;//norole D.roles = 0;//norole
D.localeId = 1;//random locale D.localeId = 1;//random locale
D.userType = 3;//non scheduleable D.userType = 3;//non scheduleable
//Required by form custom rules
D.notes = "notes";
D.customFields = Util.UserRequiredCustomFieldsJsonString();
ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString()); ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
Util.ValidateDataReturnResponseOk(R); Util.ValidateDataReturnResponseOk(R);
@@ -292,6 +310,9 @@ namespace raven_integration
D.roles = 0;//norole D.roles = 0;//norole
D.localeId = 1;//random locale D.localeId = 1;//random locale
D.userType = 3;//non scheduleable D.userType = 3;//non scheduleable
//Required by form custom rules
D.notes = "notes";
D.customFields = Util.UserRequiredCustomFieldsJsonString();
ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString()); ApiResponse R = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), D.ToString());
Util.ValidateDataReturnResponseOk(R); Util.ValidateDataReturnResponseOk(R);
@@ -344,6 +365,9 @@ namespace raven_integration
d.roles = 0;//norole d.roles = 0;//norole
d.localeId = 1;//random locale d.localeId = 1;//random locale
d.userType = 3;//non scheduleable d.userType = 3;//non scheduleable
//Required by form custom rules
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("manager", "l3tm3in"), d.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
@@ -357,6 +381,9 @@ namespace raven_integration
d.localeId = 1;//random locale d.localeId = 1;//random locale
d.userType = 3;//non scheduleable d.userType = 3;//non scheduleable
d.active = true; d.active = true;
//Required by form custom rules
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("manager", "l3tm3in"), d.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
@@ -370,6 +397,10 @@ namespace raven_integration
d.localeId = 1;//random locale d.localeId = 1;//random locale
d.userType = 3;//non scheduleable d.userType = 3;//non scheduleable
d.active = false; d.active = false;
//Required by form custom rules
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("manager", "l3tm3in"), d.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
SecondInOrderId = a.ObjectResponse["data"]["id"].Value<long>(); SecondInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
@@ -492,6 +523,10 @@ namespace raven_integration
d.roles = 0;//norole d.roles = 0;//norole
d.localeId = 1;//random locale d.localeId = 1;//random locale
d.userType = 3;//non scheduleable d.userType = 3;//non scheduleable
//Required by form custom rules
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("manager", "l3tm3in"), d.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
@@ -505,6 +540,10 @@ namespace raven_integration
d.roles = 0;//norole d.roles = 0;//norole
d.localeId = 1;//random locale d.localeId = 1;//random locale
d.userType = 2;//non scheduleable d.userType = 2;//non scheduleable
//Required by form custom rules
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("manager", "l3tm3in"), d.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
SecondInOrderId = a.ObjectResponse["data"]["id"].Value<long>(); SecondInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
@@ -517,6 +556,10 @@ namespace raven_integration
d.roles = 0;//norole d.roles = 0;//norole
d.localeId = 1;//random locale d.localeId = 1;//random locale
d.userType = 1;//non scheduleable d.userType = 1;//non scheduleable
//Required by form custom rules
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("manager", "l3tm3in"), d.ToString());
Util.ValidateDataReturnResponseOk(a); Util.ValidateDataReturnResponseOk(a);
FirstInOrderId = a.ObjectResponse["data"]["id"].Value<long>(); FirstInOrderId = a.ObjectResponse["data"]["id"].Value<long>();

View File

@@ -26,6 +26,9 @@ namespace raven_integration
D1.roles = 0;//norole D1.roles = 0;//norole
D1.localeId = 1;//random locale D1.localeId = 1;//random locale
D1.userType = 3;//non scheduleable D1.userType = 3;//non scheduleable
//Required by form custom rules
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("manager", "l3tm3in"), D1.ToString());
Util.ValidateDataReturnResponseOk(R); Util.ValidateDataReturnResponseOk(R);

26
util.cs
View File

@@ -253,7 +253,7 @@ namespace raven_integration
var ERR = a.ObjectResponse["error"]; var ERR = a.ObjectResponse["error"];
if (ERR != null) if (ERR != null)
{ {
ErrorMessage=a.ObjectResponse.ToString(); ErrorMessage = a.ObjectResponse.ToString();
// var ecode = ERR["code"]; // var ecode = ERR["code"];
// if (ecode != null) // if (ecode != null)
// ErrorMessage += $"CODE: {ecode} "; // ErrorMessage += $"CODE: {ecode} ";
@@ -431,11 +431,11 @@ namespace raven_integration
return dCustomField.ToString(); return dCustomField.ToString();
} }
/// <summary> /// <summary>
/// Generate a custom fields string that satisfies the rules in the sample test data /// Generate a custom fields string that satisfies the rules in the sample test data
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static string WidgetRequiredCustomFieldsJsonString() public static string WidgetRequiredCustomFieldsJsonString()
{/*CURRENT TEMPLATE DEFINITION FOR WIDGET CUSTOM FIELDS, FROM SEEDER.CS SERVER PROJECT {/*CURRENT TEMPLATE DEFINITION FOR WIDGET CUSTOM FIELDS, FROM SEEDER.CS SERVER PROJECT
{ {
""template"": [ ""template"": [
@@ -489,5 +489,19 @@ namespace raven_integration
} }
/// <summary>
/// Generate a custom fields string that satisfies the rules in this project (formCustom)
/// </summary>
/// <returns></returns>
public static string UserRequiredCustomFieldsJsonString()
{
//Note c1 is only required custom, c2 is defined but is not required so skipping it here
dynamic dCustomField = new JObject();
dCustomField.c1 = "UnitTestUtilSampleText";
return dCustomField.ToString();
}
}//eoc }//eoc
}//eons }//eons