This commit is contained in:
@@ -26,6 +26,7 @@ namespace AyaNova.Biz
|
||||
AddField("dollaramount", "WidgetDollarAmount", AyDataType.Decimal).
|
||||
AddField("active", "WidgetActive", AyDataType.Bool).
|
||||
AddField("startdate", "WidgetStartDate", AyDataType.Date).
|
||||
AddField("count", "WidgetCount", AyDataType.Integer).
|
||||
AddField("enddate", "WidgetEndDate", AyDataType.Date);
|
||||
|
||||
if (localizeToLocaleId != 0)
|
||||
|
||||
@@ -1435,6 +1435,7 @@
|
||||
"WidgetName":"Name",
|
||||
"WidgetSerial":"Seriennummer",
|
||||
"WidgetDollarAmount":"Betrag",
|
||||
"WidgetCount":"Anzahl",
|
||||
"WidgetActive":"Aktiv",
|
||||
"WidgetRoles":"Rollen",
|
||||
"WidgetStartDate":"Startdatum",
|
||||
|
||||
@@ -1434,6 +1434,7 @@
|
||||
"WidgetName":"Name",
|
||||
"WidgetSerial":"Serial #",
|
||||
"WidgetDollarAmount":"Price",
|
||||
"WidgetCount":"Count",
|
||||
"WidgetActive":"Active",
|
||||
"WidgetRoles":"Roles",
|
||||
"WidgetStartDate":"Start",
|
||||
|
||||
@@ -1435,6 +1435,7 @@
|
||||
"WidgetName":"Nombre",
|
||||
"WidgetSerial":"Número de serie",
|
||||
"WidgetDollarAmount":"Importe",
|
||||
"WidgetCount":"Recuento",
|
||||
"WidgetActive":"Activa",
|
||||
"WidgetRoles":"Funciones",
|
||||
"WidgetStartDate":"Fecha de comienzo",
|
||||
|
||||
@@ -1434,6 +1434,7 @@
|
||||
"WidgetName":"Nom",
|
||||
"WidgetSerial":"Numéro de série",
|
||||
"WidgetDollarAmount":"Montant",
|
||||
"WidgetCount":"Nombre",
|
||||
"WidgetActive":"Actif",
|
||||
"WidgetRoles":"Rôles",
|
||||
"WidgetStartDate":"Date de début",
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace AyaNova.Util
|
||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
||||
private const int DESIRED_SCHEMA_LEVEL = 9;
|
||||
|
||||
internal const long EXPECTED_COLUMN_COUNT = 106;
|
||||
internal const long EXPECTED_COLUMN_COUNT = 107;
|
||||
internal const long EXPECTED_INDEX_COUNT = 24;
|
||||
|
||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::PrepareDatabaseForSeeding WHEN NEW TABLES ADDED!!!!
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
ExcludedWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//CREATE FILTER
|
||||
@@ -138,13 +138,11 @@ namespace raven_integration
|
||||
|
||||
//inclusive test filter
|
||||
|
||||
HERE
|
||||
|
||||
dynamic DataFilterActive = new JObject();
|
||||
DataFilterActive.fld = "active";
|
||||
DataFilterActive.op = OpEquality;
|
||||
DataFilterActive.value = true;
|
||||
dfilter.Add(DataFilterActive);
|
||||
dynamic FilterItem = new JObject();
|
||||
FilterItem.fld = "count";
|
||||
FilterItem.op = OpEquality;
|
||||
FilterItem.value = 555;
|
||||
dfilter.Add(FilterItem);
|
||||
|
||||
d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
|
||||
|
||||
@@ -158,35 +156,30 @@ namespace raven_integration
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
//assert contains at least two records
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(1);
|
||||
//assert contains at least this test record
|
||||
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(0);
|
||||
var v = ((JArray)a.ObjectResponse["data"]);
|
||||
List<long> IDInResultList = new List<long>();
|
||||
int nActiveMatches = 0;
|
||||
int nInactiveMatches = 0;
|
||||
int InclusiveMatchCount = 0;
|
||||
int ExclusiveMatchCount = 0;
|
||||
foreach (JObject o in v)
|
||||
{
|
||||
if (ActiveWidgetIdList.Contains(o["id"].Value<long>()))
|
||||
nActiveMatches++;
|
||||
if (NotActiveWidgetIdList.Contains(o["id"].Value<long>()))
|
||||
nInactiveMatches++;
|
||||
if (IncludedWidgetId == o["id"].Value<long>())
|
||||
InclusiveMatchCount++;
|
||||
if (ExcludedWidgetId == o["id"].Value<long>())//whups
|
||||
ExclusiveMatchCount++;
|
||||
}
|
||||
|
||||
nActiveMatches.Should().Be(ActiveWidgetIdList.Count);
|
||||
nInactiveMatches.Should().Be(0);
|
||||
InclusiveMatchCount.Should().BeGreaterOrEqualTo(1);
|
||||
ExclusiveMatchCount.Should().Be(0);
|
||||
|
||||
//DELETE WIDGETS
|
||||
foreach (long l in ActiveWidgetIdList)
|
||||
{
|
||||
a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
}
|
||||
a = await Util.DeleteAsync("Widget/" + IncludedWidgetId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
a = await Util.DeleteAsync("Widget/" + ExcludedWidgetId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
|
||||
foreach (long l in NotActiveWidgetIdList)
|
||||
{
|
||||
a = await Util.DeleteAsync("Widget/" + l.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
Util.ValidateHTTPStatusCode(a, 204);
|
||||
}
|
||||
|
||||
//DELETE DATAFILTER
|
||||
a = await Util.DeleteAsync("DataFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("BizAdminFull"));
|
||||
|
||||
Reference in New Issue
Block a user