public void When_close_account_command_is_triggered_on_a_closed_account_it_should_not_raise_events()
        {
            // Arrange
            var account = new Account(Guid.NewGuid(), "Thomas");
            account.Close();

            var eventStore = new InMemoryEventRepositoryBuilder().WithAggregates(account).Build();
            var handler = new CloseAccountCommandHandler(eventStore);

            // Act
            handler.Handle(new CloseAccountCommand(account.Id));

            // Assert
            eventStore.Events.OfType<AccountClosedEvent>().Should().BeEmpty();
        }
        public void When_withdrawing_money_on_a_closed_account_it_should_throw()
        {
            // Arrange
            var account = new Account(Guid.NewGuid(), "Thomas");
            account.Close();

            var eventStore = new InMemoryEventRepositoryBuilder().WithAggregates(account).Build();
            var handler = new WithdrawMoneyCommandHandler(eventStore);

            // Act
            Action action = () => handler.Handle(new WithdrawMoneyCommand(account.Id, 200));

            // Assert
            action.ShouldThrow<InvalidOperationException>();
        }