elsa-core/test/unit/Elsa.ExternalAuthentication.UnitTests/Clients/ExternalAuthenticationClientContractTests.cs
2026-07-25 03:48:50 +02:00

21 lines
728 B
C#

using System.Text.Json;
using Elsa.Api.Client.Resources.ExternalAuthentication.Connections.Requests;
namespace Elsa.ExternalAuthentication.UnitTests.Clients;
public class ExternalAuthenticationClientContractTests
{
[Fact]
public void NewSaveRequestSerializesHostScope()
{
var request = new SaveExternalAuthenticationConnectionRequest
{
AdapterSettings = JsonSerializer.SerializeToElement(new { })
};
var json = JsonSerializer.Serialize(request, new JsonSerializerOptions(JsonSerializerDefaults.Web));
using var document = JsonDocument.Parse(json);
Assert.Equal("host", document.RootElement.GetProperty("scope").GetProperty("kind").GetString());
}
}