Browse Source

Fixed ordering unit test

pull/874/head 2.0.8
Ramón Tomás 6 years ago
parent
commit
9f5e7aee6c
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/Services/Ordering/Ordering.UnitTests/Application/NewOrderCommandHandlerTest.cs

+ 4
- 1
src/Services/Ordering/Ordering.UnitTests/Application/NewOrderCommandHandlerTest.cs View File

@ -10,6 +10,7 @@ using System.Threading.Tasks;
namespace UnitTest.Ordering.Application
{
using global::Ordering.API.Application.IntegrationEvents;
using global::Ordering.API.Application.Models;
using MediatR;
using System.Collections;
@ -22,12 +23,14 @@ namespace UnitTest.Ordering.Application
private readonly Mock<IOrderRepository> _orderRepositoryMock;
private readonly Mock<IIdentityService> _identityServiceMock;
private readonly Mock<IMediator> _mediator;
private readonly Mock<IOrderingIntegrationEventService> _orderingIntegrationEventService;
public NewOrderRequestHandlerTest()
{
_orderRepositoryMock = new Mock<IOrderRepository>();
_identityServiceMock = new Mock<IIdentityService>();
_orderingIntegrationEventService = new Mock<IOrderingIntegrationEventService>();
_mediator = new Mock<IMediator>();
}
@ -48,7 +51,7 @@ namespace UnitTest.Ordering.Application
_identityServiceMock.Setup(svc => svc.GetUserIdentity()).Returns(buyerId);
//Act
var handler = new CreateOrderCommandHandler(_mediator.Object, _orderRepositoryMock.Object, _identityServiceMock.Object);
var handler = new CreateOrderCommandHandler(_mediator.Object, _orderingIntegrationEventService.Object, _orderRepositoryMock.Object, _identityServiceMock.Object);
var cltToken = new System.Threading.CancellationToken();
var result = await handler.Handle(fakeOrderCmd, cltToken);


Loading…
Cancel
Save