You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
using ApplicationCore.Entities.OrderAggregate;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace UnitTests.Builders
|
|
{
|
|
public class OrderBuilder
|
|
{
|
|
private Order _order;
|
|
public string TestBuyerId => "12345";
|
|
public int TestCatalogItemId => 234;
|
|
public string TestProductName => "Test Product Name";
|
|
public string TestPictureUri => "http://test.com/image.jpg";
|
|
public decimal TestUnitPrice = 1.23m;
|
|
public int TestUnits = 3;
|
|
public CatalogItemOrdered TestCatalogItemOrdered { get; }
|
|
|
|
public OrderBuilder()
|
|
{
|
|
TestCatalogItemOrdered = new CatalogItemOrdered(TestCatalogItemId, TestProductName, TestPictureUri);
|
|
_order = WithDefaultValues();
|
|
}
|
|
|
|
public Order Build()
|
|
{
|
|
return _order;
|
|
}
|
|
|
|
public Order WithDefaultValues()
|
|
{
|
|
var orderItem = new OrderItem(TestCatalogItemOrdered, TestUnitPrice, TestUnits);
|
|
var itemList = new List<OrderItem>() { orderItem };
|
|
_order = new Order(TestBuyerId, new AddressBuilder().WithDefaultValues(), itemList);
|
|
return _order;
|
|
}
|
|
}
|
|
}
|
|
|