This commit is contained in:
2020-02-11 18:29:21 +00:00
parent 51f185f07b
commit dd484aed3a
8 changed files with 77 additions and 66 deletions

View File

@@ -29,7 +29,7 @@ namespace raven_integration
w1.name = Util.Uniquify("First Test WIDGET");
w1.dollarAmount = 1.11m;
w1.active = true;
w1.roles = 0;
w1.usertype = 1;
w1.notes = "The quick brown fox jumped over the six lazy dogs!";
w1.customFields = Util.WidgetRequiredCustomFieldsJsonString();
@@ -52,7 +52,7 @@ namespace raven_integration
w2.name = Util.Uniquify("Second Test WIDGET");
w2.dollarAmount = 2.22m;
w2.active = true;
w2.roles = 0;
w2.usertype = 1;
w2.notes = "What is the frequency Kenneth?";
w2.tags = dTagsArray;
w2.customFields = Util.WidgetRequiredCustomFieldsJsonString();
@@ -184,7 +184,7 @@ namespace raven_integration
w2.name = Util.Uniquify("PutConcurrencyViolationShouldFail");
w2.dollarAmount = 2.22m;
w2.active = true;
w2.roles = 0;
w2.usertype = 1;
w2.notes="blah";
w2.customFields = Util.WidgetRequiredCustomFieldsJsonString();
@@ -227,7 +227,7 @@ namespace raven_integration
w2.customFields = Util.WidgetRequiredCustomFieldsJsonString();
w2.dollarAmount = 2.22m;
w2.active = true;
w2.roles = 0;
w2.usertype = 1;
w2.customFields = Util.WidgetRequiredCustomFieldsJsonString();
ApiResponse r2 = await Util.PostAsync("Widget", await Util.GetTokenAsync("manager", "l3tm3in"), w2.ToString());

View File

@@ -47,7 +47,7 @@ namespace raven_integration
d.created = DateTime.Now.ToString();
d.dollarAmount = 1.11m;
d.active = true;
d.roles = 0;
d.usertype = 1;
//BizAdminLimited user should not be able to create a widget, only read them
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync( "BizAdminLimited"), d.ToString());

View File

@@ -23,7 +23,7 @@ namespace raven_integration
// d.created = DateTime.Now.ToString();
// d.dollarAmount = 1.11m;
// d.active = false;//<--- BROKEN RULE new widget must be active = true!!
// d.roles = 0;
// d.usertype = 1;
// //create via inventory full test user
// ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
@@ -50,7 +50,7 @@ namespace raven_integration
d.created = DateTime.Now.ToString();
d.dollarAmount = 1.11m;
d.active = true;
d.roles = 0;
d.usertype = 1;
//create via inventory full test user
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
@@ -79,7 +79,7 @@ namespace raven_integration
d.created = DateTime.Now.ToString();
d.dollarAmount = 1.11m;
d.active = true;
d.roles = 0;
d.usertype = 1;
//create via inventory full test user
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
@@ -105,7 +105,7 @@ namespace raven_integration
d.created = DateTime.Now.ToString();
d.dollarAmount = 1.11m;
d.active = true;
d.roles = 0;
d.usertype = 1;
//create via inventory full test user
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
@@ -134,7 +134,7 @@ namespace raven_integration
//NO END DATE ERRROR
d.dollarAmount = 1.11m;
d.active = true;
d.roles = 0;
d.usertype = 1;
//create via inventory full test user
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
@@ -162,7 +162,7 @@ namespace raven_integration
//NO START DATE ERRROR
d.dollarAmount = 1.11m;
d.active = true;
d.roles = 0;
d.usertype = 1;
//create via inventory full test user
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
@@ -190,7 +190,7 @@ namespace raven_integration
//NO START DATE ERRROR
d.dollarAmount = 1.11m;
d.active = true;
d.roles = 0;
d.usertype = 1;
//create via inventory full test user
ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString());
@@ -210,9 +210,6 @@ namespace raven_integration
[Fact]
public async void BusinessRuleEnumInvalidShouldError()
{
//Note: because of the way the flags work as powers of 2 and with the 1 being the first flag value, basically any value up to the "All" value will be valid
//because you can make any number from 0 to all using any combination of the flags so the only thing that will fail is less than zero or greater than All
//As of this last edit the total flags value of All for roles is 131071
dynamic d = new JObject();
d.name = Util.Uniquify("BusinessRuleEnumInvalidShouldError TEST");
@@ -221,7 +218,7 @@ namespace raven_integration
//NO END DATE ERRROR
d.dollarAmount = 1.11m;
d.active = true;
d.roles = -1;//<---BAD ROLE VALUE
d.usertype = -1;//<---BAD VALUE
d.Notes = "blah";
d.customFields = Util.WidgetRequiredCustomFieldsJsonString();
@@ -232,7 +229,7 @@ namespace raven_integration
//2002 in-valid expected
Util.ValidateErrorCodeResponse(a, 2200, 400);
Util.ShouldContainValidationError(a, "Roles", "2203");
Util.ShouldContainValidationError(a, "UserType", "2203");
}