Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 52cdd16

Browse files
committed
Fix Handler_sends_no_command_when_order_already_exists test
1 parent 89a42e6 commit 52cdd16

8 files changed

+11
-12
lines changed

src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public CancelOrderIdentifiedCommandHandler(
4343

4444
protected override bool CreateResultForDuplicateRequest()
4545
{
46-
return true; // Ignore duplicate requests for processing order.
46+
return true; // Ignore duplicate requests for processing order.
4747
}
4848
}

src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ public CreateOrderIdentifiedCommandHandler(
6767

6868
protected override bool CreateResultForDuplicateRequest()
6969
{
70-
return true; // Ignore duplicate requests for creating order.
70+
return true; // Ignore duplicate requests for creating order.
7171
}
7272
}

src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public SetAwaitingValidationIdentifiedOrderStatusCommandHandler(
4343

4444
protected override bool CreateResultForDuplicateRequest()
4545
{
46-
return true; // Ignore duplicate requests for processing order.
46+
return true; // Ignore duplicate requests for processing order.
4747
}
4848
}

src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public SetPaidIdentifiedOrderStatusCommandHandler(
4646

4747
protected override bool CreateResultForDuplicateRequest()
4848
{
49-
return true; // Ignore duplicate requests for processing order.
49+
return true; // Ignore duplicate requests for processing order.
5050
}
5151
}

src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public SetStockConfirmedOrderStatusIdentifiedCommandHandler(
4646

4747
protected override bool CreateResultForDuplicateRequest()
4848
{
49-
return true; // Ignore duplicate requests for processing order.
49+
return true; // Ignore duplicate requests for processing order.
5050
}
5151
}

src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ public SetStockRejectedOrderStatusIdentifiedCommandHandler(
4747

4848
protected override bool CreateResultForDuplicateRequest()
4949
{
50-
return true; // Ignore duplicate requests for processing order.
50+
return true; // Ignore duplicate requests for processing order.
5151
}
5252
}

src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public ShipOrderIdentifiedCommandHandler(
4343

4444
protected override bool CreateResultForDuplicateRequest()
4545
{
46-
return true; // Ignore duplicate requests for processing order.
46+
return true; // Ignore duplicate requests for processing order.
4747
}
4848
}

src/Services/Ordering/Ordering.UnitTests/Application/IdentifiedCommandHandlerTest.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public async Task Handler_sends_command_when_order_no_exists()
2626
_mediator.Setup(x => x.Send(It.IsAny<IRequest<bool>>(), default))
2727
.Returns(Task.FromResult(true));
2828

29-
//Act
29+
// Act
3030
var handler = new CreateOrderIdentifiedCommandHandler(_mediator.Object, _requestManager.Object, _loggerMock.Object);
3131
var result = await handler.Handle(fakeOrderCmd, CancellationToken.None);
3232

33-
//Assert
33+
// Assert
3434
Assert.True(result);
3535
_mediator.Verify(x => x.Send(It.IsAny<IRequest<bool>>(), default), Times.Once());
3636
}
@@ -48,12 +48,11 @@ public async Task Handler_sends_no_command_when_order_already_exists()
4848
_mediator.Setup(x => x.Send(It.IsAny<IRequest<bool>>(), default))
4949
.Returns(Task.FromResult(true));
5050

51-
//Act
51+
// Act
5252
var handler = new CreateOrderIdentifiedCommandHandler(_mediator.Object, _requestManager.Object, _loggerMock.Object);
5353
var result = await handler.Handle(fakeOrderCmd, CancellationToken.None);
5454

55-
//Assert
56-
Assert.False(result);
55+
// Assert
5756
_mediator.Verify(x => x.Send(It.IsAny<IRequest<bool>>(), default), Times.Never());
5857
}
5958

0 commit comments

Comments
 (0)