From 11ba3c5a711306e2d8d3b4d5b5f59819a851f412 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 7 Jan 2020 21:15:03 +0000 Subject: [PATCH] --- Enum/EnumListOps.cs | 2 +- Widget/WidgetValidationTests.cs | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Enum/EnumListOps.cs b/Enum/EnumListOps.cs index bd8fba5..1257c1d 100644 --- a/Enum/EnumListOps.cs +++ b/Enum/EnumListOps.cs @@ -35,7 +35,7 @@ namespace raven_integration Util.ValidateHTTPStatusCode(a, 200); ((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(5); - a.ObjectResponse["data"][3]["name"].Value().Should().Be("Client user"); + a.ObjectResponse["data"][3]["name"].Value().Should().Be("Customer user"); a.ObjectResponse["data"][3]["id"].Value().Should().Be(4); } diff --git a/Widget/WidgetValidationTests.cs b/Widget/WidgetValidationTests.cs index d1c04ac..0733d94 100644 --- a/Widget/WidgetValidationTests.cs +++ b/Widget/WidgetValidationTests.cs @@ -45,7 +45,7 @@ namespace raven_integration //CREATE attempt with broken rules dynamic d = new JObject(); d.name = Util.Uniquify("BusinessRuleNameMustBeUnique TEST WIDGET"); - d.notes="blah"; + d.notes = "blah"; d.customFields = Util.WidgetRequiredCustomFieldsJsonString(); d.created = DateTime.Now.ToString(); d.dollarAmount = 1.11m; @@ -210,6 +210,9 @@ 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"); @@ -218,7 +221,10 @@ namespace raven_integration //NO END DATE ERRROR d.dollarAmount = 1.11m; d.active = true; - d.roles = 99999;//<---BAD ROLE VALUE + d.roles = -1;//<---BAD ROLE VALUE + d.Notes = "blah"; + d.customFields = Util.WidgetRequiredCustomFieldsJsonString(); + //create via inventory full test user ApiResponse a = await Util.PostAsync("Widget", await Util.GetTokenAsync("InventoryFull"), d.ToString()); @@ -226,7 +232,7 @@ namespace raven_integration //2002 in-valid expected Util.ValidateErrorCodeResponse(a, 2200, 400); - Util.ShouldContainValidationError(a, "Roles", "2203"); + Util.ShouldContainValidationError(a, "Notes", "2201"); }