Heimdall Gitea / Detect CI scope (pull_request) Successful in 6s
Heimdall Gitea / Build and tests (pull_request) Failing after 20m25s
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 3s
28 lines
1008 B
C#
28 lines
1008 B
C#
using Heimdall.Api.Controllers;
|
|
using Heimdall.Application.Services;
|
|
using Heimdall.Infrastructure.Services;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Options;
|
|
using MediatR;
|
|
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, Substitute.For<IMediator>());
|
|
|
|
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);
|
|
}
|
|
}
|