mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-25 23:18:56 -07:00
22 lines
719 B
C#
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());
|
|
}
|
|
}
|