From 4e0e6151c98e761c5e0142dce4e80310a1290a2c Mon Sep 17 00:00:00 2001 From: Paul Howes Date: Thu, 16 Apr 2020 16:27:55 +0100 Subject: [PATCH] Added new nuget package --- .../AccountLevyStatusEventHandlerTests.cs | 51 +++++++++---------- .../AccountLevyStatusEventHandler.cs | 32 ++++++------ ...AS.EmployerAccounts.MessageHandlers.csproj | 2 +- .../SFA.DAS.EmployerAccounts.csproj | 2 +- 4 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/SFA.DAS.EmployerAccounts.MessageHandlers.UnitTests/EventHandlers/AccountLevyStatusEventHandlerTests.cs b/src/SFA.DAS.EmployerAccounts.MessageHandlers.UnitTests/EventHandlers/AccountLevyStatusEventHandlerTests.cs index 4365d3941f..f3816aaff3 100644 --- a/src/SFA.DAS.EmployerAccounts.MessageHandlers.UnitTests/EventHandlers/AccountLevyStatusEventHandlerTests.cs +++ b/src/SFA.DAS.EmployerAccounts.MessageHandlers.UnitTests/EventHandlers/AccountLevyStatusEventHandlerTests.cs @@ -12,33 +12,32 @@ namespace SFA.DAS.EmployerAccounts.MessageHandlers.UnitTests.EventHandlers { - //[ExcludeFromCodeCoverage] - //[TestFixture] - //public class AccountLevyStatusEventHandlerTests - //{ - // private AccountLevyStatusEventHandler _handler; - // private long _accountId = 90210; - // private Mock _mediatr; + [ExcludeFromCodeCoverage] + [TestFixture] + public class AccountLevyStatusEventHandlerTests + { + private AccountLevyStatusEventHandler _handler; + private long _accountId = 90210; + private Mock _mediatr; - // [SetUp] - // public void Setup() - // { - // _mediatr = new Mock(); - // _handler = new AccountLevyStatusEventHandler(_mediatr.Object); - // } + [SetUp] + public void Setup() + { + _mediatr = new Mock(); + _handler = new AccountLevyStatusEventHandler(_mediatr.Object); + } - // [Test] - // public async Task Handle_AccountLevyStatusEvent() - // { - // await _handler.Handle(new AccountLevyStatusEvent - // { - // AccountId = _accountId, - // ApprenticeEmployerType = ApprenticeshipEmployerType.Levy - // }, - // Mock.Of()); + [Test] + public async Task Handle_AccountLevyStatusEvent() + { + await _handler.Handle(new AccountLevyStatusEvent + { + AccountId = _accountId, + ApprenticeshipEmployerType = ApprenticeshipEmployerType.Levy + }, + Mock.Of()); - - // _mediatr.Verify(m => m.SendAsync(It.Is(cmd => cmd.AccountId == _accountId && cmd.ApprenticeshipEmployerType == ApprenticeshipEmployerType.Levy))); - // } - //} + _mediatr.Verify(m => m.SendAsync(It.Is(cmd => cmd.AccountId == _accountId && cmd.ApprenticeshipEmployerType == ApprenticeshipEmployerType.Levy))); + } + } } \ No newline at end of file diff --git a/src/SFA.DAS.EmployerAccounts.MessageHandlers/EventHandlers/AccountLevyStatusEventHandler.cs b/src/SFA.DAS.EmployerAccounts.MessageHandlers/EventHandlers/AccountLevyStatusEventHandler.cs index 012db72c52..e2fb6b0acc 100644 --- a/src/SFA.DAS.EmployerAccounts.MessageHandlers/EventHandlers/AccountLevyStatusEventHandler.cs +++ b/src/SFA.DAS.EmployerAccounts.MessageHandlers/EventHandlers/AccountLevyStatusEventHandler.cs @@ -6,22 +6,22 @@ namespace SFA.DAS.EmployerAccounts.MessageHandlers.EventHandlers { - //public class AccountLevyStatusEventHandler : IHandleMessages - //{ - // private readonly IMediator _mediatr; + public class AccountLevyStatusEventHandler : IHandleMessages + { + private readonly IMediator _mediatr; - // public AccountLevyStatusEventHandler(IMediator mediatr) - // { - // _mediatr = mediatr; - // } + public AccountLevyStatusEventHandler(IMediator mediatr) + { + _mediatr = mediatr; + } - // public async Task Handle(AccountLevyStatusEvent message, IMessageHandlerContext context) - // { - // await _mediatr.SendAsync(new AccountLevyStatusCommand - // { - // AccountId = message.AccountId, - // ApprenticeshipEmployerType = message.ApprenticeshipEmployerType - // }); - // } - //} + public async Task Handle(AccountLevyStatusEvent message, IMessageHandlerContext context) + { + await _mediatr.SendAsync(new AccountLevyStatusCommand + { + AccountId = message.AccountId, + ApprenticeshipEmployerType = message.ApprenticeshipEmployerType + }); + } + } } \ No newline at end of file diff --git a/src/SFA.DAS.EmployerAccounts.MessageHandlers/SFA.DAS.EmployerAccounts.MessageHandlers.csproj b/src/SFA.DAS.EmployerAccounts.MessageHandlers/SFA.DAS.EmployerAccounts.MessageHandlers.csproj index 36cde3c3f2..630382f791 100644 --- a/src/SFA.DAS.EmployerAccounts.MessageHandlers/SFA.DAS.EmployerAccounts.MessageHandlers.csproj +++ b/src/SFA.DAS.EmployerAccounts.MessageHandlers/SFA.DAS.EmployerAccounts.MessageHandlers.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj b/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj index 3e8313d2df..d7499a8be6 100644 --- a/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj +++ b/src/SFA.DAS.EmployerAccounts/SFA.DAS.EmployerAccounts.csproj @@ -36,7 +36,7 @@ - +