46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System;
|
|
using Xunit;
|
|
using Newtonsoft.Json.Linq;
|
|
using FluentAssertions;
|
|
|
|
namespace raven_integration
|
|
{
|
|
|
|
public class EnumListOps
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[Fact]
|
|
public async void GetListOfEnumListsAndGetAllEnumListsWorks()
|
|
{
|
|
ApiResponse a = await Util.GetAsync("enum-list/listkeys", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
|
Util.ValidateDataReturnResponseOk(a);
|
|
Util.ValidateHTTPStatusCode(a, 200);
|
|
((JArray)a.ObjectResponse["data"]).Count.Should().BeGreaterThan(2);
|
|
|
|
//iterate all the list names and fetch each one in turn and see that it fetches ok and has at least 2 list items in it
|
|
foreach (JObject jListName in a.ObjectResponse["data"])
|
|
{
|
|
|
|
ApiResponse b = await Util.GetAsync($"enum-list/list/{jListName["key"].Value<string>()}", await Util.GetTokenAsync("superuser", "l3tm3in"));
|
|
Util.ValidateDataReturnResponseOk(b);
|
|
Util.ValidateHTTPStatusCode(b, 200);
|
|
((JArray)b.ObjectResponse["data"]).Count.Should().BeGreaterThan(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//==================================================
|
|
|
|
}//eoc
|
|
}//eons
|