using FinancialApi.Application.Commands; using FinancialApi.Application.Interfaces; using FinancialApi.Domain.Entities; using FinancialApi.Domain.Events; using FluentAssertions; using Wolverine; using Wolverine.Tracking; namespace FinancialApi.Infrastructure.Tests; internal class FakeAccountQuery : IAccountQuery { public Task FindByIdAsync(int id) => Task.FromResult(new Account(id, 100.00m, AccountType.Spend))!; } public class ApplyFeeIntegrationTests(WolverineTestFixture fixture) : IClassFixture { [Fact] public async Task GivenValidCommand_WhenApplyingFee_ShouldPublishFeeAppliedEvent() { // Arrange var command = new ApplyFeeCommand(1, 100); // Act var session = await fixture.Host.InvokeMessageAndWaitAsync(command); // Assert session.Sent.AllMessages() .ShouldHaveMessageOfType(); session.Sent.MessagesOf() .Count() .Should() .Be(1); } }