3 changed files with 75 additions and 1 deletions
@ -0,0 +1,37 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Shouldly; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace EShopOnAbp.OrderingService.Orders; |
||||
|
|
||||
|
public class OrderManagerUnitTests : OrderingServiceDomainTestBase |
||||
|
{ |
||||
|
private readonly OrderManager _orderManager; |
||||
|
|
||||
|
public OrderManagerUnitTests() |
||||
|
{ |
||||
|
_orderManager = GetRequiredService<OrderManager>(); |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public async Task Should_CreateOrderAsync() |
||||
|
{ |
||||
|
var orderItems = |
||||
|
new List<(Guid productId, string productName, string productCode, decimal unitPrice, decimal discount, |
||||
|
string pictureUrl, int |
||||
|
units)>(); |
||||
|
orderItems.Add((Guid.NewGuid(), "Test product", "Code:001", 15, 0, "", 1)); |
||||
|
var createdOrder = await _orderManager.CreateOrderAsync( |
||||
|
1, |
||||
|
"gterdem", |
||||
|
"gterdem@volosoft.com", |
||||
|
orderItems, |
||||
|
"Test Street", |
||||
|
"Test City", |
||||
|
"Test Country", |
||||
|
"Test zipCode"); |
||||
|
createdOrder.ShouldNotBeNull(); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue