mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-25 23:18:56 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user