Files
Radicade/ServerTests/PlatformNotificationsTests.cs
2026-10-16 23:33:13 -07:00

22 lines
719 B
C#

using System.Text.Json;
using Microsoft.AspNetCore.Mvc;
using RadicadeServer.API.Notifications;
using Xunit;
namespace RadicadeServer.Tests;
public class PlatformNotificationsTests
{
[Fact]
public void CategoriesReturnsCountedObjectForClientDeserializer()
{
var response = Assert.IsType<OkObjectResult>(new PlatformNotificationsAPI().GetCategories());
var json = JsonSerializer.SerializeToElement(response.Value);
Assert.Equal(JsonValueKind.Object, json.ValueKind);
var results = json.GetProperty("Results");
Assert.Equal(JsonValueKind.Array, results.ValueKind);
Assert.Equal(results.GetArrayLength(), json.GetProperty("TotalResults").GetInt64());
}
}