Skip to content

Commit

Permalink
Added new nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Howes committed Apr 16, 2020
1 parent bf5d4af commit 4e0e615
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<IMediator> _mediatr;
[ExcludeFromCodeCoverage]
[TestFixture]
public class AccountLevyStatusEventHandlerTests
{
private AccountLevyStatusEventHandler _handler;
private long _accountId = 90210;
private Mock<IMediator> _mediatr;

// [SetUp]
// public void Setup()
// {
// _mediatr = new Mock<IMediator>();
// _handler = new AccountLevyStatusEventHandler(_mediatr.Object);
// }
[SetUp]
public void Setup()
{
_mediatr = new Mock<IMediator>();
_handler = new AccountLevyStatusEventHandler(_mediatr.Object);
}

// [Test]
// public async Task Handle_AccountLevyStatusEvent()
// {
// await _handler.Handle(new AccountLevyStatusEvent
// {
// AccountId = _accountId,
// ApprenticeEmployerType = ApprenticeshipEmployerType.Levy
// },
// Mock.Of<IMessageHandlerContext>());
[Test]
public async Task Handle_AccountLevyStatusEvent()
{
await _handler.Handle(new AccountLevyStatusEvent
{
AccountId = _accountId,
ApprenticeshipEmployerType = ApprenticeshipEmployerType.Levy
},
Mock.Of<IMessageHandlerContext>());


// _mediatr.Verify(m => m.SendAsync(It.Is<AccountLevyStatusCommand>(cmd => cmd.AccountId == _accountId && cmd.ApprenticeshipEmployerType == ApprenticeshipEmployerType.Levy)));
// }
//}
_mediatr.Verify(m => m.SendAsync(It.Is<AccountLevyStatusCommand>(cmd => cmd.AccountId == _accountId && cmd.ApprenticeshipEmployerType == ApprenticeshipEmployerType.Levy)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@

namespace SFA.DAS.EmployerAccounts.MessageHandlers.EventHandlers
{
//public class AccountLevyStatusEventHandler : IHandleMessages<AccountLevyStatusEvent>
//{
// private readonly IMediator _mediatr;
public class AccountLevyStatusEventHandler : IHandleMessages<AccountLevyStatusEvent>
{
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
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="SFA.DAS.AutoConfiguration" Version="2.0.1" />
<PackageReference Include="SFA.DAS.Authentication" Version="1.1.2" />
<PackageReference Include="SFA.DAS.Commitments.Events" Version="2.1.1073" />
<PackageReference Include="SFA.DAS.EmployerFinance.Messages" Version="1.6.1140" />
<PackageReference Include="SFA.DAS.EmployerFinance.Messages" Version="1.6.2930" />
<PackageReference Include="SFA.DAS.Messaging" Version="3.0.0.63765" />
<PackageReference Include="SFA.DAS.NLog.Logger" Version="1.2.1" />
<PackageReference Include="SFA.DAS.NLog.Targets.Redis" Version="1.2.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<PackageReference Include="SFA.DAS.EmployerUsers.WebClientComponents" Version="1.0.0.52781" />
<PackageReference Include="SFA.DAS.Encoding" Version="1.1.61" />
<PackageReference Include="SFA.DAS.EntityFramework" Version="1.0.1" />
<PackageReference Include="SFA.DAS.EmployerFinance.Messages" Version="1.6.890" />
<PackageReference Include="SFA.DAS.EmployerFinance.Messages" Version="1.6.2930" />
<PackageReference Include="SFA.DAS.HashingService" Version="1.0.183" />
<PackageReference Include="SFA.DAS.Hmrc" Version="1.0.16" />
<PackageReference Include="SFA.DAS.Notifications.Api.Client" Version="2.2.37" />
Expand Down

0 comments on commit 4e0e615

Please sign in to comment.