This commit is contained in:
@@ -436,6 +436,30 @@ namespace raven_integration
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async void UserPickListDefaultSortNoFilterWorks()
|
||||
{
|
||||
var RouteName = "User";//##########
|
||||
|
||||
//NOW FETCH LIST WITH FILTER
|
||||
ApiResponse a = await Util.GetAsync($"{RouteName}/picklist?Offset=0&Limit=999", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
//assert contains exactly 3 records
|
||||
var ItemCount = ((JArray)a.ObjectResponse["data"]).Count;
|
||||
|
||||
for (int i = 0; i < ItemCount - 1; i++)
|
||||
{
|
||||
var firstName = a.ObjectResponse["data"][i]["name"].Value<string>().Replace(" ","");
|
||||
var secondName = a.ObjectResponse["data"][i + 1]["name"].Value<string>().Replace(" ","");
|
||||
int comparison = String.Compare(firstName, secondName, comparisonType: StringComparison.OrdinalIgnoreCase);
|
||||
comparison.Should().BeNegative();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,36 @@ namespace raven_integration
|
||||
public class WidgetLists
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async void WidgetPickListDefaultSortNoFilterWorks()
|
||||
{
|
||||
var RouteName = "Widget";//##########
|
||||
|
||||
//NOW FETCH LIST WITH FILTER
|
||||
ApiResponse a = await Util.GetAsync($"{RouteName}/picklist?Offset=0&Limit=999", await Util.GetTokenAsync("manager", "l3tm3in"));
|
||||
Util.ValidateDataReturnResponseOk(a);
|
||||
Util.ValidateHTTPStatusCode(a, 200);
|
||||
|
||||
//assert contains exactly 3 records
|
||||
var ItemCount = ((JArray)a.ObjectResponse["data"]).Count;
|
||||
|
||||
for (int i = 0; i < ItemCount - 1; i++)
|
||||
{
|
||||
//Note it's necessary to replace the spaces because postgres thinks spaces go last and the string comparison thinks they go first
|
||||
var firstName = a.ObjectResponse["data"][i]["name"].Value<string>().Replace(" ","");
|
||||
var secondName = a.ObjectResponse["data"][i + 1]["name"].Value<string>().Replace(" ","");
|
||||
int comparison = String.Compare(firstName, secondName, comparisonType: StringComparison.OrdinalIgnoreCase);
|
||||
comparison.Should().BeNegative();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -20,7 +50,7 @@ namespace raven_integration
|
||||
{
|
||||
|
||||
var NameStart = Util.Uniquify("WidgetPickListSortByFieldAscendingWorks");
|
||||
var RouteName="Widget";
|
||||
var RouteName = "Widget";
|
||||
|
||||
//CREATE 3 TEST OBJECTS TO TEST ORDER
|
||||
long FirstInOrderId = 0;
|
||||
|
||||
Reference in New Issue
Block a user