﻿using System;
using System.Threading.Tasks;
using Cumulus.Handlers;
using Cumulus.IntegrationTests.Tests.PoisonMessageTests.MessageContracts;
using Cumulus.Tests.Common;

namespace Cumulus.IntegrationTests.Tests.PoisonMessageTests.CommandHandlers
{
    public class GoBangCommandHandler : IHandleCommand<GoBangCommand>
    {
        public async Task Handle(GoBangCommand busCommand)
        {
            MethodCallCounter.RecordCall<GoBangCommandHandler>(h => h.Handle(busCommand));

            throw new Exception("This handler is supposed to fail.");
        }
    }
}