feat(application): IAvisoQueryRepository + NullAvisoQueryRepository (CAT-002)

This commit is contained in:
2026-04-19 08:18:56 -03:00
parent ddd28ea4d5
commit 673194e249
4 changed files with 87 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
using FluentAssertions;
using SIGCM2.Application.Avisos;
namespace SIGCM2.Application.Tests.Avisos;
public class NullAvisoQueryRepositoryTests
{
private readonly NullAvisoQueryRepository _repo = new();
[Fact]
public async Task CountAvisosEnRubroAsync_Always_ReturnsZero()
{
var result = await _repo.CountAvisosEnRubroAsync(rubroId: 99);
result.Should().Be(0);
}
[Fact]
public async Task CountAvisosBatchAsync_WithIds_ReturnsDictionaryAllZero()
{
var result = await _repo.CountAvisosBatchAsync([1, 2, 3]);
result.GetValueOrDefault(1, 0).Should().Be(0);
result.GetValueOrDefault(2, 0).Should().Be(0);
result.GetValueOrDefault(3, 0).Should().Be(0);
}
[Fact]
public async Task CountAvisosBatchAsync_EmptyIds_ReturnsEmptyDictionary()
{
var result = await _repo.CountAvisosBatchAsync([]);
result.Should().HaveCount(0);
}
}