23 lines
665 B
C#
23 lines
665 B
C#
using StellaOps.AirGap.Policy;
|
|
using StellaOps.TestKit;
|
|
using System;
|
|
using Xunit;
|
|
|
|
namespace StellaOps.AirGap.Policy.Tests;
|
|
|
|
public sealed partial class EgressPolicyTests
|
|
{
|
|
[Trait("Category", TestCategories.Unit)]
|
|
[Fact]
|
|
public void EgressHttpClientFactory_Create_EnforcesPolicyBeforeReturningClient()
|
|
{
|
|
var recordingPolicy = new RecordingPolicy();
|
|
var request = new EgressRequest("Component", new Uri("https://allowed.internal"), "mirror-sync");
|
|
|
|
using var client = EgressHttpClientFactory.Create(recordingPolicy, request);
|
|
|
|
Assert.True(recordingPolicy.EnsureAllowedCalled);
|
|
Assert.NotNull(client);
|
|
}
|
|
}
|