Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
1.3 KiB

// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using FluentAssertions;
using Squidex.Domain.Apps.Core.Apps;
using Squidex.Domain.Apps.Core.TestHelpers;
using Xunit;
namespace Squidex.Domain.Apps.Core.Model.Apps
{
public class AppClientJsonTests
{
[Fact]
public void Should_serialize_and_deserialize()
{
var clients = AppClients.Empty;
clients = clients.Add("1", "my-secret");
clients = clients.Add("2", "my-secret");
clients = clients.Add("3", "my-secret");
clients = clients.Add("4", "my-secret");
clients = clients.Update("3", role: Role.Editor);
clients = clients.Update("3", name: "My Client 3");
clients = clients.Update("2", name: "My Client 2");
clients = clients.Update("1", allowAnonymous: true, apiCallsLimit: 3);
clients = clients.Revoke("4");
var serialized = clients.SerializeAndDeserialize();
serialized.Should().BeEquivalentTo(clients);
}
}
}