Files
Heimdall/tests/Heimdall.Web.Tests/Controllers/PlateRecognitionControllerTests.cs
T
arnaud.dartois 3208bc93fe
Heimdall Gitea / Detect CI scope (pull_request) Successful in 1m27s
Heimdall Gitea / Build and tests (pull_request) Failing after 12m27s
Heimdall Gitea / Build and scan server image (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Skipped
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Failing after 4s
feat: complete local camera and operations acceptance
2026-11-05 11:02:41 +01:00

27 lines
964 B
C#

using Heimdall.Api.Controllers;
using Heimdall.Application.Services;
using Heimdall.Infrastructure.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using NSubstitute;
using Xunit;
namespace Heimdall.Web.Tests.Controllers;
public sealed class PlateRecognitionControllerTests
{
[Fact]
public async Task Recognition_is_disabled_by_default_and_does_not_call_OCR()
{
var config = Substitute.For<IOptionsMonitor<PlateOcrOptions>>();
config.CurrentValue.Returns(new PlateOcrOptions());
var service = Substitute.For<ILicensePlateRecognitionService>();
var controller = new PlateRecognitionController(null!, service, config);
var result = await controller.Recognize(Guid.NewGuid(), null, CancellationToken.None);
Assert.Equal(503, Assert.IsType<ObjectResult>(result).StatusCode);
await service.DidNotReceiveWithAnyArgs().RecognizeAsync(default, default, default);
}
}