4648
This commit is contained in:
@@ -31,101 +31,108 @@ namespace raven_integration
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//NOTE: These tests are for Debug builds, they should still pass in a release build because none of the creds will work and it checks for 401 only
|
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//but a true test of these JWT tokens is only in server debug mode
|
/// case 4648 Removed all these jwt related tests for expediency
|
||||||
|
/// they relied on an ancient setup in auth
|
||||||
/// <summary>
|
/// that no longer exists and I'm not sure how
|
||||||
///
|
/// useful they are
|
||||||
/// </summary>
|
|
||||||
[Fact]
|
|
||||||
public async Task JWTExpiredTokenShouldFail()
|
|
||||||
{
|
|
||||||
|
|
||||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
|
||||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
|
||||||
if (BuildMode == "DEBUG")
|
|
||||||
{
|
|
||||||
a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "EXPIRED"));//lowest level test user because there are no limits on this route except to be authenticated
|
|
||||||
Util.ValidateHTTPStatusCode(a, 401);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
[Fact]
|
|
||||||
public async Task JWTWrongIssuerShouldFail()
|
|
||||||
{
|
|
||||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
|
||||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
|
||||||
if (BuildMode == "DEBUG")
|
|
||||||
{
|
|
||||||
a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_ISSUER"));//lowest level test user because there are no limits on this route except to be authenticated
|
|
||||||
Util.ValidateHTTPStatusCode(a, 401);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
[Fact]
|
|
||||||
public async Task JWTNoAlgorithmShouldFail()
|
|
||||||
{
|
|
||||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
|
||||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
|
||||||
if (BuildMode == "DEBUG")
|
|
||||||
{
|
|
||||||
a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "NO_ALGORITHM"));
|
|
||||||
Util.ValidateHTTPStatusCode(a, 401);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
[Fact]
|
|
||||||
public async Task JWTBadSecretShouldFail()
|
|
||||||
{
|
|
||||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
|
||||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
|
||||||
if (BuildMode == "DEBUG")
|
|
||||||
{
|
|
||||||
a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_SECRET"));
|
|
||||||
Util.ValidateHTTPStatusCode(a, 401);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// //NOTE: These tests are for Debug builds, they should still pass in a release build because none of the creds will work and it checks for 401 only
|
||||||
///
|
// //but a true test of these JWT tokens is only in server debug mode
|
||||||
/// </summary>
|
|
||||||
[Fact]
|
// /// <summary>
|
||||||
public async Task JWTTruncatedSignatureShouldFail()
|
// ///
|
||||||
{
|
// /// </summary>
|
||||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// [Fact]
|
||||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
// public async Task JWTExpiredTokenShouldFail()
|
||||||
if (BuildMode == "DEBUG")
|
// {
|
||||||
{
|
|
||||||
a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "TRUNCATED_SIGNATURE"));
|
// ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 401);
|
// var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||||
}
|
// if (BuildMode == "DEBUG")
|
||||||
}
|
// {
|
||||||
|
// a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "EXPIRED"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||||
|
// Util.ValidateHTTPStatusCode(a, 401);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /// <summary>
|
||||||
|
// ///
|
||||||
|
// /// </summary>
|
||||||
|
// [Fact]
|
||||||
|
// public async Task JWTWrongIssuerShouldFail()
|
||||||
|
// {
|
||||||
|
// ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
|
// var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||||
|
// if (BuildMode == "DEBUG")
|
||||||
|
// {
|
||||||
|
// a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_ISSUER"));//lowest level test user because there are no limits on this route except to be authenticated
|
||||||
|
// Util.ValidateHTTPStatusCode(a, 401);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /// <summary>
|
||||||
|
// ///
|
||||||
|
// /// </summary>
|
||||||
|
// [Fact]
|
||||||
|
// public async Task JWTNoAlgorithmShouldFail()
|
||||||
|
// {
|
||||||
|
// ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
|
// var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||||
|
// if (BuildMode == "DEBUG")
|
||||||
|
// {
|
||||||
|
// a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "NO_ALGORITHM"));
|
||||||
|
// Util.ValidateHTTPStatusCode(a, 401);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /// <summary>
|
||||||
|
// ///
|
||||||
|
// /// </summary>
|
||||||
|
// [Fact]
|
||||||
|
// public async Task JWTBadSecretShouldFail()
|
||||||
|
// {
|
||||||
|
// ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
|
// var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||||
|
// if (BuildMode == "DEBUG")
|
||||||
|
// {
|
||||||
|
// a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "WRONG_SECRET"));
|
||||||
|
// Util.ValidateHTTPStatusCode(a, 401);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
///
|
// ///
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task JWTTransposedSignatureShouldFail()
|
// public async Task JWTTruncatedSignatureShouldFail()
|
||||||
{
|
// {
|
||||||
ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
// var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||||
if (BuildMode == "DEBUG")
|
// if (BuildMode == "DEBUG")
|
||||||
{
|
// {
|
||||||
a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "TRANSPOSE_SIGNATURE"));
|
// a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "TRUNCATED_SIGNATURE"));
|
||||||
Util.ValidateHTTPStatusCode(a, 401);
|
// Util.ValidateHTTPStatusCode(a, 401);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// /// <summary>
|
||||||
|
// ///
|
||||||
|
// /// </summary>
|
||||||
|
// [Fact]
|
||||||
|
// public async Task JWTTransposedSignatureShouldFail()
|
||||||
|
// {
|
||||||
|
// ApiResponse a = await Util.GetAsync("build-mode", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
|
// var BuildMode = a.ObjectResponse["data"]["buildMode"].Value<string>();
|
||||||
|
// if (BuildMode == "DEBUG")
|
||||||
|
// {
|
||||||
|
// a = await Util.GetAsync("translation/list", await Util.GetTokenAsync("INTEGRATION_TEST", "TRANSPOSE_SIGNATURE"));
|
||||||
|
// Util.ValidateHTTPStatusCode(a, 401);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,30 +1,30 @@
|
|||||||
using Xunit;
|
// using Xunit;
|
||||||
using Newtonsoft.Json.Linq;
|
// using Newtonsoft.Json.Linq;
|
||||||
using FluentAssertions;
|
// using FluentAssertions;
|
||||||
|
|
||||||
namespace raven_integration
|
// namespace raven_integration
|
||||||
{
|
// {
|
||||||
|
|
||||||
public class DataListRights
|
// public class DataListRights
|
||||||
{
|
// {
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
///
|
// ///
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task InsufficentRightsShouldNotRetrieve()
|
// public async Task InsufficentRightsShouldNotRetrieve()
|
||||||
{
|
// {
|
||||||
//Get without rights
|
// //Get without rights
|
||||||
/*
|
// /*
|
||||||
"{\"error\":{\"code\":\"2004\",\"message\":\"User not authorized for this resource operation (insufficient rights)\"}}"
|
// "{\"error\":{\"code\":\"2004\",\"message\":\"User not authorized for this resource operation (insufficient rights)\"}}"
|
||||||
*/
|
// */
|
||||||
//ApiResponse a = await Util.GetAsync("data-list/list?DataListKey=TestWidgetDataList&Offset=0&Limit=3", await Util.GetTokenAsync("CustomerRestricted"));
|
// //ApiResponse a = await Util.GetAsync("data-list/list?DataListKey=TestWidgetDataList&Offset=0&Limit=3", await Util.GetTokenAsync("CustomerRestricted"));
|
||||||
ApiResponse a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("CustomerRestricted"), Util.BuildDataListRequestEx());
|
// ApiResponse a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("CustomerRestricted"), Util.BuildDataListRequestEx());
|
||||||
Util.ValidateErrorCodeResponse(a, 2004, 403);
|
// Util.ValidateErrorCodeResponse(a, 2004, 403);
|
||||||
}
|
// }
|
||||||
|
|
||||||
//==================================================
|
// //==================================================
|
||||||
|
|
||||||
}//eoc
|
// }//eoc
|
||||||
}//eons
|
// }//eons
|
||||||
|
|||||||
@@ -1,413 +1,413 @@
|
|||||||
using System;
|
// using System;
|
||||||
using Xunit;
|
// using Xunit;
|
||||||
using Newtonsoft.Json.Linq;
|
// using Newtonsoft.Json.Linq;
|
||||||
using FluentAssertions;
|
// using FluentAssertions;
|
||||||
using System.Collections.Generic;
|
// using System.Collections.Generic;
|
||||||
using System.Collections.Concurrent;
|
// using System.Collections.Concurrent;
|
||||||
|
|
||||||
namespace raven_integration
|
// namespace raven_integration
|
||||||
{
|
// {
|
||||||
|
|
||||||
|
|
||||||
public class DataListSorting
|
// public class DataListSorting
|
||||||
{
|
// {
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
///
|
// ///
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task DefaultSortByIdWorks()
|
// public async Task DefaultSortByIdWorks()
|
||||||
{
|
// {
|
||||||
|
|
||||||
var WidgetNameStart = Util.Uniquify("DefaultSortByIdWorks");
|
// var WidgetNameStart = Util.Uniquify("DefaultSortByIdWorks");
|
||||||
|
|
||||||
//CREATE 3 TEST WIDGETS TO TEST ORDER
|
// //CREATE 3 TEST WIDGETS TO TEST ORDER
|
||||||
long FirstInOrderWidgetId = 0;
|
// long FirstInOrderWidgetId = 0;
|
||||||
long SecondInOrderWidgetId = 0;
|
// long SecondInOrderWidgetId = 0;
|
||||||
long ThirdInOrderWidgetId = 0;
|
// long ThirdInOrderWidgetId = 0;
|
||||||
|
|
||||||
dynamic w = new JObject();
|
// dynamic w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
|
||||||
//CREATE FILTER
|
// //CREATE FILTER
|
||||||
|
|
||||||
dynamic dListView = new JArray();
|
// dynamic dListView = new JArray();
|
||||||
|
|
||||||
|
|
||||||
//name starts with filter to constrict to widgets that this test block created only
|
// //name starts with filter to constrict to widgets that this test block created only
|
||||||
|
|
||||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart));
|
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart));
|
||||||
|
|
||||||
//NOW FETCH WIDGET LIST WITH FILTER
|
// //NOW FETCH WIDGET LIST WITH FILTER
|
||||||
// a = await Util.GetAsync($"data-list/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// // a = await Util.GetAsync($"data-list/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId={DataFilterId.ToString()}", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
// a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
// Util.ValidateHTTPStatusCode(a, 200);
|
||||||
|
|
||||||
//assert contains exactly 3 records
|
// //assert contains exactly 3 records
|
||||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
// ((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
||||||
|
|
||||||
//assert the order returned
|
// //assert the order returned
|
||||||
a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
// a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
// a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
// a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||||
|
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
///
|
// ///
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task SortByFieldAscendingWorks()
|
// public async Task SortByFieldAscendingWorks()
|
||||||
{
|
// {
|
||||||
|
|
||||||
var WidgetNameStart = Util.Uniquify("SortByFieldAscendingWorks");
|
// var WidgetNameStart = Util.Uniquify("SortByFieldAscendingWorks");
|
||||||
|
|
||||||
//CREATE 3 TEST WIDGETS TO TEST ORDER
|
// //CREATE 3 TEST WIDGETS TO TEST ORDER
|
||||||
long FirstInOrderWidgetId = 0;
|
// long FirstInOrderWidgetId = 0;
|
||||||
long SecondInOrderWidgetId = 0;
|
// long SecondInOrderWidgetId = 0;
|
||||||
long ThirdInOrderWidgetId = 0;
|
// long ThirdInOrderWidgetId = 0;
|
||||||
|
|
||||||
dynamic w = new JObject();
|
// dynamic w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.startDate = DateTime.Now;
|
// w.startDate = DateTime.Now;
|
||||||
w.endDate = DateTime.Now.AddHours(1);
|
// w.endDate = DateTime.Now.AddHours(1);
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.startDate = DateTime.Now.AddHours(1);
|
// w.startDate = DateTime.Now.AddHours(1);
|
||||||
w.endDate = DateTime.Now.AddHours(2);
|
// w.endDate = DateTime.Now.AddHours(2);
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.startDate = DateTime.Now.AddHours(2);
|
// w.startDate = DateTime.Now.AddHours(2);
|
||||||
w.endDate = DateTime.Now.AddHours(3);
|
// w.endDate = DateTime.Now.AddHours(3);
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
|
||||||
//CREATE FILTER
|
// //CREATE FILTER
|
||||||
//FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
// //FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
||||||
dynamic dListView = new JArray();
|
// dynamic dListView = new JArray();
|
||||||
//name starts with filter to constrict to widgets that this test block created only
|
// //name starts with filter to constrict to widgets that this test block created only
|
||||||
|
|
||||||
|
|
||||||
//SORT ORDER ###################
|
// //SORT ORDER ###################
|
||||||
// dynamic dsortarray = new JArray();
|
// // dynamic dsortarray = new JArray();
|
||||||
// dynamic dsort = new JObject();
|
// // dynamic dsort = new JObject();
|
||||||
// dsort.fld = "widgetstartdate";
|
// // dsort.fld = "widgetstartdate";
|
||||||
// dsort.dir = "+";
|
// // dsort.dir = "+";
|
||||||
// dsortarray.Add(dsort);
|
// // dsortarray.Add(dsort);
|
||||||
|
|
||||||
//both conditions filter and sort here
|
// //both conditions filter and sort here
|
||||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart, "+"));
|
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart, "+"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//NOW FETCH WIDGET LIST WITH FILTER
|
// //NOW FETCH WIDGET LIST WITH FILTER
|
||||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
// a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
// Util.ValidateHTTPStatusCode(a, 200);
|
||||||
|
|
||||||
//assert contains exactly 3 records
|
// //assert contains exactly 3 records
|
||||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
// ((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
||||||
|
|
||||||
//assert the order returned
|
// //assert the order returned
|
||||||
a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
// a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
// a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
// a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||||
|
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
///
|
// ///
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task SortByFieldDescendingWorks()
|
// public async Task SortByFieldDescendingWorks()
|
||||||
{
|
// {
|
||||||
|
|
||||||
var WidgetNameStart = Util.Uniquify("SortByFieldDescendingWorks");
|
// var WidgetNameStart = Util.Uniquify("SortByFieldDescendingWorks");
|
||||||
|
|
||||||
//CREATE 3 TEST WIDGETS TO TEST ORDER
|
// //CREATE 3 TEST WIDGETS TO TEST ORDER
|
||||||
long FirstInOrderWidgetId = 0;
|
// long FirstInOrderWidgetId = 0;
|
||||||
long SecondInOrderWidgetId = 0;
|
// long SecondInOrderWidgetId = 0;
|
||||||
long ThirdInOrderWidgetId = 0;
|
// long ThirdInOrderWidgetId = 0;
|
||||||
|
|
||||||
dynamic w = new JObject();
|
// dynamic w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.count = 999;
|
// w.count = 999;
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.count = 665;
|
// w.count = 665;
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.count = 333;
|
// w.count = 333;
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
|
||||||
//CREATE FILTER
|
// //CREATE FILTER
|
||||||
|
|
||||||
//FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
// //FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
||||||
dynamic dListView = new JArray();
|
// dynamic dListView = new JArray();
|
||||||
//name starts with filter to constrict to widgets that this test block created only
|
// //name starts with filter to constrict to widgets that this test block created only
|
||||||
|
|
||||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart));
|
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart));
|
||||||
|
|
||||||
|
|
||||||
//SORT ORDER ###################
|
// //SORT ORDER ###################
|
||||||
// dynamic dsortarray = new JArray();
|
// // dynamic dsortarray = new JArray();
|
||||||
// dynamic dsort = new JObject();
|
// // dynamic dsort = new JObject();
|
||||||
// dsort.fld = "widgetcount";
|
// // dsort.fld = "widgetcount";
|
||||||
// dsort.dir = "-";
|
// // dsort.dir = "-";
|
||||||
dListView.Add(Util.BuildSimpleSortDataListViewColumn("widgetcount", "-"));
|
// dListView.Add(Util.BuildSimpleSortDataListViewColumn("widgetcount", "-"));
|
||||||
|
|
||||||
//NOW FETCH WIDGET LIST WITH FILTER
|
// //NOW FETCH WIDGET LIST WITH FILTER
|
||||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
// a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
// Util.ValidateHTTPStatusCode(a, 200);
|
||||||
|
|
||||||
//assert contains exactly 3 records
|
// //assert contains exactly 3 records
|
||||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
// ((JArray)a.ObjectResponse["data"]).Count.Should().Be(3);
|
||||||
|
|
||||||
//assert the order returned
|
// //assert the order returned
|
||||||
a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
// a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
// a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
// a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||||
|
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
///
|
// ///
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task SortByMultipleFieldsWorks()
|
// public async Task SortByMultipleFieldsWorks()
|
||||||
{
|
// {
|
||||||
/*
|
// /*
|
||||||
|
|
||||||
Created order:
|
// Created order:
|
||||||
dollaramount, count
|
// dollaramount, count
|
||||||
2,1
|
// 2,1
|
||||||
1,2
|
// 1,2
|
||||||
2,2
|
// 2,2
|
||||||
1,1
|
// 1,1
|
||||||
|
|
||||||
|
|
||||||
sorted order:
|
// sorted order:
|
||||||
dollar asc, count desc
|
// dollar asc, count desc
|
||||||
1,2
|
// 1,2
|
||||||
1,1
|
// 1,1
|
||||||
2,2
|
// 2,2
|
||||||
2,1
|
// 2,1
|
||||||
|
|
||||||
*/
|
// */
|
||||||
var WidgetNameStart = Util.Uniquify("SortByMultipleFieldsWorks");
|
// var WidgetNameStart = Util.Uniquify("SortByMultipleFieldsWorks");
|
||||||
|
|
||||||
//CREATE 4 TEST WIDGETS TO TEST ORDER
|
// //CREATE 4 TEST WIDGETS TO TEST ORDER
|
||||||
long FirstInOrderWidgetId = 0;
|
// long FirstInOrderWidgetId = 0;
|
||||||
long SecondInOrderWidgetId = 0;
|
// long SecondInOrderWidgetId = 0;
|
||||||
long ThirdInOrderWidgetId = 0;
|
// long ThirdInOrderWidgetId = 0;
|
||||||
long FourthInOrderWidgetId = 0;
|
// long FourthInOrderWidgetId = 0;
|
||||||
|
|
||||||
dynamic w = new JObject();
|
// dynamic w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.dollaramount = 2.22;
|
// w.dollaramount = 2.22;
|
||||||
w.count = 1;
|
// w.count = 1;
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
FourthInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// FourthInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.dollaramount = 1.11;
|
// w.dollaramount = 1.11;
|
||||||
w.count = 2;
|
// w.count = 2;
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// FirstInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.dollaramount = 1.11;
|
// w.dollaramount = 1.11;
|
||||||
w.count = 1;
|
// w.count = 1;
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// SecondInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
w = new JObject();
|
// w = new JObject();
|
||||||
w.name = Util.Uniquify(WidgetNameStart);
|
// w.name = Util.Uniquify(WidgetNameStart);
|
||||||
w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
// w.customFields = Util.WidgetRequiredCustomFieldsJsonString();
|
||||||
w.notes = "blah";
|
// w.notes = "blah";
|
||||||
w.dollaramount = 2.22;
|
// w.dollaramount = 2.22;
|
||||||
w.count = 2;
|
// w.count = 2;
|
||||||
w.usertype = 1;
|
// w.usertype = 1;
|
||||||
a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
// a = await Util.PostAsync("widget", await Util.GetTokenAsync("superuser", "l3tm3in"), w.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
// ThirdInOrderWidgetId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
|
||||||
//CREATE FILTER
|
// //CREATE FILTER
|
||||||
|
|
||||||
//FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
// //FILTER IN BY NAME FOR TESTING THIS RUN ONLY
|
||||||
dynamic dListView = new JArray();
|
// dynamic dListView = new JArray();
|
||||||
//name starts with filter to constrict to widgets that this test block created only
|
// //name starts with filter to constrict to widgets that this test block created only
|
||||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart));
|
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, WidgetNameStart));
|
||||||
|
|
||||||
//SORT ORDER ###################
|
// //SORT ORDER ###################
|
||||||
// dynamic dsortarray = new JArray();
|
// // dynamic dsortarray = new JArray();
|
||||||
|
|
||||||
//First column
|
// //First column
|
||||||
// dynamic dsort1 = new JObject();
|
// // dynamic dsort1 = new JObject();
|
||||||
// dsort1.fld = "widgetdollaramount";
|
// // dsort1.fld = "widgetdollaramount";
|
||||||
// dsort1.dir = "+";
|
// // dsort1.dir = "+";
|
||||||
// dsortarray.Add(dsort1);
|
// // dsortarray.Add(dsort1);
|
||||||
dListView.Add(Util.BuildSimpleSortDataListViewColumn("widgetdollaramount", "+"));
|
// dListView.Add(Util.BuildSimpleSortDataListViewColumn("widgetdollaramount", "+"));
|
||||||
|
|
||||||
//Second column
|
// //Second column
|
||||||
// dynamic dsort2 = new JObject();
|
// // dynamic dsort2 = new JObject();
|
||||||
// dsort2.fld = "widgetcount";
|
// // dsort2.fld = "widgetcount";
|
||||||
// dsort2.dir = "-";
|
// // dsort2.dir = "-";
|
||||||
// dsortarray.Add(dsort2);
|
// // dsortarray.Add(dsort2);
|
||||||
dListView.Add(Util.BuildSimpleSortDataListViewColumn("widgetcount", "-"));
|
// dListView.Add(Util.BuildSimpleSortDataListViewColumn("widgetcount", "-"));
|
||||||
|
|
||||||
|
|
||||||
//NOW FETCH WIDGET LIST WITH FILTER
|
// //NOW FETCH WIDGET LIST WITH FILTER
|
||||||
a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
// a = await Util.PostAsync($"data-list", await Util.GetTokenAsync("superuser", "l3tm3in"), Util.BuildDataListRequestEx(dListView));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
// Util.ValidateHTTPStatusCode(a, 200);
|
||||||
|
|
||||||
//assert contains exactly 3 records
|
// //assert contains exactly 3 records
|
||||||
((JArray)a.ObjectResponse["data"]).Count.Should().Be(4);
|
// ((JArray)a.ObjectResponse["data"]).Count.Should().Be(4);
|
||||||
|
|
||||||
//assert the order returned
|
// //assert the order returned
|
||||||
a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
// a.ObjectResponse["data"][0][0]["i"].Value<long>().Should().Be(FirstInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
// a.ObjectResponse["data"][1][0]["i"].Value<long>().Should().Be(SecondInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
// a.ObjectResponse["data"][2][0]["i"].Value<long>().Should().Be(ThirdInOrderWidgetId);
|
||||||
a.ObjectResponse["data"][3][0]["i"].Value<long>().Should().Be(FourthInOrderWidgetId);
|
// a.ObjectResponse["data"][3][0]["i"].Value<long>().Should().Be(FourthInOrderWidgetId);
|
||||||
|
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + FirstInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + SecondInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + ThirdInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
a = await Util.DeleteAsync("widget/" + FourthInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
// a = await Util.DeleteAsync("widget/" + FourthInOrderWidgetId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
// Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
//========================================================================
|
// //========================================================================
|
||||||
|
|
||||||
}//eoc
|
// }//eoc
|
||||||
}//eons
|
// }//eons
|
||||||
|
|||||||
@@ -1,202 +1,202 @@
|
|||||||
using System;
|
// using System;
|
||||||
using Xunit;
|
// using Xunit;
|
||||||
using Newtonsoft.Json.Linq;
|
// using Newtonsoft.Json.Linq;
|
||||||
using FluentAssertions;
|
// using FluentAssertions;
|
||||||
using System.Collections.Generic;
|
// using System.Collections.Generic;
|
||||||
using System.Collections.Concurrent;
|
// using System.Collections.Concurrent;
|
||||||
|
|
||||||
namespace raven_integration
|
// namespace raven_integration
|
||||||
{
|
// {
|
||||||
|
|
||||||
public class DataListFilterCrud
|
// public class DataListFilterCrud
|
||||||
{
|
// {
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
/// Test all CRUD routes
|
// /// Test all CRUD routes
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task CRUD()
|
// public async Task CRUD()
|
||||||
{
|
// {
|
||||||
//CREATE
|
// //CREATE
|
||||||
dynamic d = new JObject();
|
// dynamic d = new JObject();
|
||||||
d.name = Util.Uniquify("Test DataListView");
|
// d.name = Util.Uniquify("Test DataListView");
|
||||||
|
|
||||||
d["public"] = true;
|
// d["public"] = true;
|
||||||
d.listKey="TestWidgetDataList";
|
// d.listKey="TestWidgetDataList";
|
||||||
|
|
||||||
//"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
|
// //"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
|
||||||
dynamic dListView = new JArray();
|
// dynamic dListView = new JArray();
|
||||||
// dynamic df = new JObject();
|
// // dynamic df = new JObject();
|
||||||
// df.fld = "widgetname";
|
// // df.fld = "widgetname";
|
||||||
// df.op = "%-";
|
// // df.op = "%-";
|
||||||
// df.value = "Generic";//lots of seed widgets start with Generic
|
// // df.value = "Generic";//lots of seed widgets start with Generic
|
||||||
// dListView.Add(df);
|
// // dListView.Add(df);
|
||||||
// d.filter = dListView.ToString();//it expects it to be a json string, not actual json
|
// // d.filter = dListView.ToString();//it expects it to be a json string, not actual json
|
||||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, "Generic"));
|
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, "Generic"));
|
||||||
d.listView=dListView.ToString(Newtonsoft.Json.Formatting.None);
|
// d.listView=dListView.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString(Newtonsoft.Json.Formatting.None));
|
// ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString(Newtonsoft.Json.Formatting.None));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
|
|
||||||
long Id = a.ObjectResponse["data"]["id"].Value<long>();
|
// long Id = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
|
||||||
//RETRIEVE
|
// //RETRIEVE
|
||||||
//Get one
|
// //Get one
|
||||||
a = await Util.GetAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("BizAdmin"));
|
// a = await Util.GetAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("BizAdmin"));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
a.ObjectResponse["data"]["name"].Value<string>().Should().StartWith("Test DataListView");
|
// a.ObjectResponse["data"]["name"].Value<string>().Should().StartWith("Test DataListView");
|
||||||
|
|
||||||
//Get as alternate user should work for public filter
|
// //Get as alternate user should work for public filter
|
||||||
a = await Util.GetAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("SubContractorRestricted"));
|
// a = await Util.GetAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("SubContractorRestricted"));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
// Util.ValidateDataReturnResponseOk(a);
|
||||||
a.ObjectResponse["data"]["name"].Value<string>().Should().StartWith("Test DataListView");
|
// a.ObjectResponse["data"]["name"].Value<string>().Should().StartWith("Test DataListView");
|
||||||
|
|
||||||
|
|
||||||
//UPDATE
|
// //UPDATE
|
||||||
|
|
||||||
//PUT, make private
|
// //PUT, make private
|
||||||
d["public"] = false;
|
// d["public"] = false;
|
||||||
d.name = Util.Uniquify("Put - Test DataListView (privatized)");
|
// d.name = Util.Uniquify("Put - Test DataListView (privatized)");
|
||||||
d.concurrency = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
// d.concurrency = a.ObjectResponse["data"]["concurrency"].Value<uint>();
|
||||||
a = await Util.PutAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
// a = await Util.PutAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
||||||
Util.ValidateHTTPStatusCode(a, 200);
|
// Util.ValidateHTTPStatusCode(a, 200);
|
||||||
|
|
||||||
//check PUT worked
|
// //check PUT worked
|
||||||
a = await Util.GetAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("BizAdmin"));
|
// a = await Util.GetAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("BizAdmin"));
|
||||||
Util.ValidateNoErrorInResponse(a);
|
// Util.ValidateNoErrorInResponse(a);
|
||||||
a.ObjectResponse["data"]["name"].Value<string>().Should().Be(d.name.ToString());
|
// a.ObjectResponse["data"]["name"].Value<string>().Should().Be(d.name.ToString());
|
||||||
|
|
||||||
|
|
||||||
//FETCH DISALLOWED
|
// //FETCH DISALLOWED
|
||||||
//Get as alternate user should fail for private filter
|
// //Get as alternate user should fail for private filter
|
||||||
a = await Util.GetAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("SubContractorRestricted"));
|
// a = await Util.GetAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("SubContractorRestricted"));
|
||||||
Util.ValidateResponseNotFound(a);
|
// Util.ValidateResponseNotFound(a);
|
||||||
|
|
||||||
// //DELETE
|
// // //DELETE
|
||||||
ApiResponse DELETETestResponse = await Util.DeleteAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("BizAdmin"));
|
// ApiResponse DELETETestResponse = await Util.DeleteAsync("data-list-view/" + Id.ToString(), await Util.GetTokenAsync("BizAdmin"));
|
||||||
Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
// Util.ValidateHTTPStatusCode(DELETETestResponse, 204);
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
///
|
// ///
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task InvalidListKeyShouldFail()
|
// public async Task InvalidListKeyShouldFail()
|
||||||
{
|
// {
|
||||||
//CREATE
|
// //CREATE
|
||||||
dynamic d = new JObject();
|
// dynamic d = new JObject();
|
||||||
d.name = Util.Uniquify("Test DataListView");
|
// d.name = Util.Uniquify("Test DataListView");
|
||||||
|
|
||||||
d["public"] = true;
|
// d["public"] = true;
|
||||||
d.listKey = "nonexistant";
|
// d.listKey = "nonexistant";
|
||||||
|
|
||||||
//"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
|
// //"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
|
||||||
// dynamic dfilter = new JArray();
|
// // dynamic dfilter = new JArray();
|
||||||
// dynamic df = new JObject();
|
// // dynamic df = new JObject();
|
||||||
// df.fld = "name";
|
// // df.fld = "name";
|
||||||
// df.op = "%-";
|
// // df.op = "%-";
|
||||||
// df.value = "Generic";//lots of seed widgets start with Generic
|
// // df.value = "Generic";//lots of seed widgets start with Generic
|
||||||
// dfilter.Add(df);
|
// // dfilter.Add(df);
|
||||||
|
|
||||||
// d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
|
// // d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
|
||||||
|
|
||||||
// ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
// // ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
||||||
|
|
||||||
dynamic dListView = new JArray();
|
// dynamic dListView = new JArray();
|
||||||
// dynamic df = new JObject();
|
// // dynamic df = new JObject();
|
||||||
// df.fld = "widgetname";
|
// // df.fld = "widgetname";
|
||||||
// df.op = "%-";
|
// // df.op = "%-";
|
||||||
// df.value = "Generic";//lots of seed widgets start with Generic
|
// // df.value = "Generic";//lots of seed widgets start with Generic
|
||||||
// dListView.Add(df);
|
// // dListView.Add(df);
|
||||||
// d.filter = dListView.ToString();//it expects it to be a json string, not actual json
|
// // d.filter = dListView.ToString();//it expects it to be a json string, not actual json
|
||||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, "Generic"));
|
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("widgetname", Util.OpStartsWith, "Generic"));
|
||||||
d.listView=dListView.ToString(Newtonsoft.Json.Formatting.None);
|
// d.listView=dListView.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString(Newtonsoft.Json.Formatting.None));
|
// ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString(Newtonsoft.Json.Formatting.None));
|
||||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
// Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||||
Util.ShouldContainValidationError(a, "ListKey", "2203");
|
// Util.ShouldContainValidationError(a, "ListKey", "2203");
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
///
|
// ///
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[Fact]
|
// [Fact]
|
||||||
public async Task InvalidFieldNameShouldFail()
|
// public async Task InvalidFieldNameShouldFail()
|
||||||
{
|
// {
|
||||||
//CREATE
|
// //CREATE
|
||||||
dynamic d = new JObject();
|
// dynamic d = new JObject();
|
||||||
d.name = Util.Uniquify("Test DataListView");
|
// d.name = Util.Uniquify("Test DataListView");
|
||||||
|
|
||||||
d["public"] = true;
|
// d["public"] = true;
|
||||||
d.listKey="TestWidgetDataList";
|
// d.listKey="TestWidgetDataList";
|
||||||
|
|
||||||
//"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
|
// //"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
|
||||||
// dynamic dfilter = new JArray();
|
// // dynamic dfilter = new JArray();
|
||||||
// dynamic df = new JObject();
|
// // dynamic df = new JObject();
|
||||||
// df.fld = "doesntexist";
|
// // df.fld = "doesntexist";
|
||||||
// df.op = "%-";
|
// // df.op = "%-";
|
||||||
// df.value = "Generic";//lots of seed widgets start with Generic
|
// // df.value = "Generic";//lots of seed widgets start with Generic
|
||||||
// dfilter.Add(df);
|
// // dfilter.Add(df);
|
||||||
|
|
||||||
// d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
|
// // d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
|
||||||
|
|
||||||
// ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
// // ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
||||||
dynamic dListView = new JArray();
|
// dynamic dListView = new JArray();
|
||||||
// dynamic df = new JObject();
|
// // dynamic df = new JObject();
|
||||||
// df.fld = "widgetname";
|
// // df.fld = "widgetname";
|
||||||
// df.op = "%-";
|
// // df.op = "%-";
|
||||||
// df.value = "Generic";//lots of seed widgets start with Generic
|
// // df.value = "Generic";//lots of seed widgets start with Generic
|
||||||
// dListView.Add(df);
|
// // dListView.Add(df);
|
||||||
// d.filter = dListView.ToString();//it expects it to be a json string, not actual json
|
// // d.filter = dListView.ToString();//it expects it to be a json string, not actual json
|
||||||
dListView.Add(Util.BuildSimpleFilterDataListViewColumn("doesntexist", Util.OpStartsWith, "Generic"));
|
// dListView.Add(Util.BuildSimpleFilterDataListViewColumn("doesntexist", Util.OpStartsWith, "Generic"));
|
||||||
d.listView=dListView.ToString(Newtonsoft.Json.Formatting.None);
|
// d.listView=dListView.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
|
|
||||||
ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString(Newtonsoft.Json.Formatting.None));
|
// ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString(Newtonsoft.Json.Formatting.None));
|
||||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
// Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||||
Util.ShouldContainValidationError(a, "ListView", "2203");
|
// Util.ShouldContainValidationError(a, "ListView", "2203");
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//REMOVED THIS VALIDATION TEST AS SWITCH TO DATALISTVIEW NO LONGER VALIDATES FILTER ANYWAY
|
// //REMOVED THIS VALIDATION TEST AS SWITCH TO DATALISTVIEW NO LONGER VALIDATES FILTER ANYWAY
|
||||||
//ONLY COLUMN NAMES AND LIST NAME
|
// //ONLY COLUMN NAMES AND LIST NAME
|
||||||
// /// <summary>
|
// // /// <summary>
|
||||||
// ///
|
// // ///
|
||||||
// /// </summary>
|
// // /// </summary>
|
||||||
// [Fact]
|
// // [Fact]
|
||||||
// public async Task InvalidOperatorShouldFail()
|
// // public async Task InvalidOperatorShouldFail()
|
||||||
// {
|
// // {
|
||||||
// //CREATE
|
// // //CREATE
|
||||||
// dynamic d = new JObject();
|
// // dynamic d = new JObject();
|
||||||
// d.name = Util.Uniquify("Test DataListView");
|
// // d.name = Util.Uniquify("Test DataListView");
|
||||||
|
|
||||||
// d["public"] = true;
|
// // d["public"] = true;
|
||||||
// d.listKey="TestWidgetDataList";
|
// // d.listKey="TestWidgetDataList";
|
||||||
|
|
||||||
// //"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
|
// // //"[{fld:"name",op:"!=",value:"Notequaltothis"},{fld:"tags",op:"Eq",value:"[23,456,54]"}]
|
||||||
// dynamic dfilter = new JArray();
|
// // dynamic dfilter = new JArray();
|
||||||
// dynamic df = new JObject();
|
// // dynamic df = new JObject();
|
||||||
// df.fld = "name";
|
// // df.fld = "name";
|
||||||
// df.op = "wtf";
|
// // df.op = "wtf";
|
||||||
// df.value = "Generic";//lots of seed widgets start with Generic
|
// // df.value = "Generic";//lots of seed widgets start with Generic
|
||||||
// dfilter.Add(df);
|
// // dfilter.Add(df);
|
||||||
|
|
||||||
// d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
|
// // d.filter = dfilter.ToString();//it expects it to be a json string, not actual json
|
||||||
|
|
||||||
// ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
// // ApiResponse a = await Util.PostAsync("data-list-view", await Util.GetTokenAsync("BizAdmin"), d.ToString());
|
||||||
// Util.ValidateErrorCodeResponse(a, 2200, 400);
|
// // Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||||
// Util.ShouldContainValidationError(a, "Filter", "2203");
|
// // Util.ShouldContainValidationError(a, "Filter", "2203");
|
||||||
|
|
||||||
// }
|
// // }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==================================================
|
// //==================================================
|
||||||
|
|
||||||
}//eoc
|
// }//eoc
|
||||||
}//eons
|
// }//eons
|
||||||
|
|||||||
Reference in New Issue
Block a user