This commit is contained in:
@@ -98,7 +98,7 @@ namespace AyaNova
|
|||||||
bool LOG_SENSITIVE_DATA = false;
|
bool LOG_SENSITIVE_DATA = false;
|
||||||
|
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
LOG_SENSITIVE_DATA = true;
|
//LOG_SENSITIVE_DATA = true;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ namespace AyaNova
|
|||||||
// ******************** TESTING WIPE DB *****************************
|
// ******************** TESTING WIPE DB *****************************
|
||||||
//
|
//
|
||||||
//Set this to true to wipe the db and reinstall a trial license and re-seed the data
|
//Set this to true to wipe the db and reinstall a trial license and re-seed the data
|
||||||
var TESTING_REFRESH_DB = true;//#############################################################################################
|
var TESTING_REFRESH_DB = false;//#############################################################################################
|
||||||
|
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
//TESTING
|
//TESTING
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ namespace raven_integration
|
|||||||
|
|
||||||
var ObjectNameStart = Util.Uniquify("UserListFilterAndSortWorks");
|
var ObjectNameStart = Util.Uniquify("UserListFilterAndSortWorks");
|
||||||
|
|
||||||
//CREATE 3 TEST WIDGETS TO TEST ORDER
|
//CREATE 3 TEST OBJECTS TO TEST ORDER
|
||||||
long FirstInOrdertId = 0;
|
long FirstInOrdertId = 0;
|
||||||
long SecondInOrderId = 0;
|
long SecondInOrderId = 0;
|
||||||
long ThirdInOrderId = 0;
|
long ThirdInOrderId = 0;
|
||||||
@@ -436,6 +436,120 @@ namespace raven_integration
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Fact]
|
||||||
|
public async void UserPickListSortByFieldAscendingWorks()
|
||||||
|
{
|
||||||
|
|
||||||
|
var NameStart = Util.Uniquify("UserPickListSortByFieldAscendingWorks");
|
||||||
|
|
||||||
|
//CREATE 3 TEST objects TO TEST ORDER
|
||||||
|
long FirstInOrderId = 0;
|
||||||
|
long SecondInOrderId = 0;
|
||||||
|
long ThirdInOrderId = 0;
|
||||||
|
|
||||||
|
dynamic d = new JObject();
|
||||||
|
d.name = Util.Uniquify(NameStart);
|
||||||
|
d.active = false;
|
||||||
|
d.login = Util.Uniquify("LOGIN");
|
||||||
|
d.password = Util.Uniquify("PASSWORD");
|
||||||
|
d.roles = 0;//norole
|
||||||
|
d.localeId = 1;//random locale
|
||||||
|
d.userType = 3;//non scheduleable
|
||||||
|
|
||||||
|
ApiResponse a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||||
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
|
ThirdInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
d = new JObject();
|
||||||
|
d.name = Util.Uniquify(NameStart);
|
||||||
|
d.active = true;
|
||||||
|
d.login = Util.Uniquify("LOGIN");
|
||||||
|
d.password = Util.Uniquify("PASSWORD");
|
||||||
|
d.roles = 0;//norole
|
||||||
|
d.localeId = 1;//random locale
|
||||||
|
d.userType = 2;//non scheduleable
|
||||||
|
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||||
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
|
SecondInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
d = new JObject();
|
||||||
|
d.name = Util.Uniquify(NameStart);
|
||||||
|
d.active = false;
|
||||||
|
d.login = Util.Uniquify("LOGIN");
|
||||||
|
d.password = Util.Uniquify("PASSWORD");
|
||||||
|
d.roles = 0;//norole
|
||||||
|
d.localeId = 1;//random locale
|
||||||
|
d.userType = 1;//non scheduleable
|
||||||
|
a = await Util.PostAsync("User", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||||
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
|
FirstInOrderId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
|
||||||
|
//CREATE FILTER
|
||||||
|
d = new JObject();
|
||||||
|
d.name = Util.Uniquify(NameStart);
|
||||||
|
d["public"] = true;
|
||||||
|
d.listKey = "user";
|
||||||
|
|
||||||
|
//FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
||||||
|
dynamic dfilter = new JArray();
|
||||||
|
//name starts with filter to constrict to widgets that this test block created only
|
||||||
|
dynamic DataFilterNameStart = new JObject();
|
||||||
|
DataFilterNameStart.fld = "name";
|
||||||
|
DataFilterNameStart.op = Util.OpStartsWith;
|
||||||
|
DataFilterNameStart.value = NameStart;
|
||||||
|
dfilter.Add(DataFilterNameStart);
|
||||||
|
d.filter = dfilter.ToString();
|
||||||
|
|
||||||
|
//SORT ORDER ###################
|
||||||
|
dynamic dsortarray = new JArray();
|
||||||
|
dynamic dsort = new JObject();
|
||||||
|
dsort.fld = "usertype";
|
||||||
|
dsort.dir = "+";
|
||||||
|
dsortarray.Add(dsort);
|
||||||
|
d.sort = dsortarray.ToString();
|
||||||
|
|
||||||
|
a = await Util.PostAsync("DataFilter", await Util.GetTokenAsync("manager", "l3tm3in"), d.ToString());
|
||||||
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
|
|
||||||
|
long DataFilterId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
//NOW FETCH WIDGET LIST WITH FILTER
|
||||||
|
a = await Util.GetAsync($"User/picklist?Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
|
Util.ValidateHTTPStatusCode(a, 200);
|
||||||
|
|
||||||
|
//assert contains exactly 3 records
|
||||||
|
((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
||||||
|
|
||||||
|
//assert the order returned
|
||||||
|
a.ObjectResponse["data"][0]["id"].Value<long>().Should().Be(FirstInOrderId);
|
||||||
|
a.ObjectResponse["data"][1]["id"].Value<long>().Should().Be(SecondInOrderId);
|
||||||
|
a.ObjectResponse["data"][2]["id"].Value<long>().Should().Be(ThirdInOrderId);
|
||||||
|
|
||||||
|
|
||||||
|
a = await Util.DeleteAsync("User/" + FirstInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
|
Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
|
a = await Util.DeleteAsync("User/" + SecondInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
|
Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
|
a = await Util.DeleteAsync("User/" + ThirdInOrderId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
|
Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
|
//DELETE DATAFILTER
|
||||||
|
a = await Util.DeleteAsync("DataFilter/" + DataFilterId.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||||
|
Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//==================================================
|
//==================================================
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ namespace raven_integration
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Fact]
|
[Fact]
|
||||||
public async void PickListSortByFieldAscendingWorks()
|
public async void WidgetPickListSortByFieldAscendingWorks()
|
||||||
{
|
{
|
||||||
|
|
||||||
var WidgetNameStart = Util.Uniquify("PickListSortByFieldAscendingWorks");
|
var WidgetNameStart = Util.Uniquify("WidgetPickListSortByFieldAscendingWorks");
|
||||||
|
|
||||||
//CREATE 3 TEST WIDGETS TO TEST ORDER
|
//CREATE 3 TEST WIDGETS TO TEST ORDER
|
||||||
long FirstInOrderWidgetId = 0;
|
long FirstInOrderWidgetId = 0;
|
||||||
@@ -151,23 +151,26 @@ namespace raven_integration
|
|||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
Util.ValidateHTTPStatusCode(a, 200);
|
||||||
a.ObjectResponse["data"]["key"].Value<string>().Should().Be("widget");
|
a.ObjectResponse["data"]["key"].Value<string>().Should().Be("widget");
|
||||||
((JArray)a.ObjectResponse["data"]["flds"]).Count.Should().Be(9);
|
((JArray)a.ObjectResponse["data"]["flds"]).Count.Should().Be(10);
|
||||||
a.ObjectResponse["data"]["flds"][3]["lt"].Value<string>().Should().Be("Price");
|
|
||||||
|
int DollarAmountFieldNumber = 4;
|
||||||
|
|
||||||
|
a.ObjectResponse["data"]["flds"][DollarAmountFieldNumber]["lt"].Value<string>().Should().Be("Price");
|
||||||
|
|
||||||
a = await Util.GetAsync("Widget/FilterOptions", await Util.GetTokenAsync("es", "es"));
|
a = await Util.GetAsync("Widget/FilterOptions", await Util.GetTokenAsync("es", "es"));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
Util.ValidateHTTPStatusCode(a, 200);
|
||||||
a.ObjectResponse["data"]["flds"][3]["lt"].Value<string>().Should().Be("Importe");
|
a.ObjectResponse["data"]["flds"][DollarAmountFieldNumber]["lt"].Value<string>().Should().Be("Importe");
|
||||||
|
|
||||||
a = await Util.GetAsync("Widget/FilterOptions", await Util.GetTokenAsync("fr", "fr"));
|
a = await Util.GetAsync("Widget/FilterOptions", await Util.GetTokenAsync("fr", "fr"));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
Util.ValidateHTTPStatusCode(a, 200);
|
||||||
a.ObjectResponse["data"]["flds"][3]["lt"].Value<string>().Should().Be("Montant");
|
a.ObjectResponse["data"]["flds"][DollarAmountFieldNumber]["lt"].Value<string>().Should().Be("Montant");
|
||||||
|
|
||||||
a = await Util.GetAsync("Widget/FilterOptions", await Util.GetTokenAsync("de", "de"));
|
a = await Util.GetAsync("Widget/FilterOptions", await Util.GetTokenAsync("de", "de"));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
Util.ValidateHTTPStatusCode(a, 200);
|
||||||
a.ObjectResponse["data"]["flds"][3]["lt"].Value<string>().Should().Be("Betrag");
|
a.ObjectResponse["data"]["flds"][DollarAmountFieldNumber]["lt"].Value<string>().Should().Be("Betrag");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user