Skip to content

Commit

Permalink
Fixed ordering unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramón Tomás committed Nov 12, 2018
1 parent 9b21ac1 commit 9f5e7ae
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace UnitTest.Ordering.Application
{
using global::Ordering.API.Application.IntegrationEvents;
using global::Ordering.API.Application.Models;
using MediatR;
using System.Collections;
Expand All @@ -22,12 +23,14 @@ public class NewOrderRequestHandlerTest
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>();
}

Expand All @@ -48,7 +51,7 @@ public async Task Handle_return_false_if_order_is_not_persisted()
_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);

Expand Down

0 comments on commit 9f5e7ae

Please sign in to comment.