Shady nagy/net6 (#614)
* udated to .net6 * used the .net6 version RC2 * added editconfig. * App core new Scoped Namespaces style. * BlazorAdmin new Scoped Namespaces style. * Blazor Shared new Scoped Namespaces style. * Infra new Scoped Namespaces style. * public api new Scoped Namespaces style. * web new Scoped Namespaces style. * FunctionalTests new Scoped Namespaces style. * Integrational tests new Scoped Namespaces style. * unit tests new Scoped Namespaces style. * update github action. * update github action. * change the global.
This commit is contained in:
@@ -1,28 +1,27 @@
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||
|
||||
namespace Microsoft.eShopWeb.UnitTests.Builders
|
||||
{
|
||||
public class AddressBuilder
|
||||
{
|
||||
private Address _address;
|
||||
public string TestStreet => "123 Main St.";
|
||||
public string TestCity => "Kent";
|
||||
public string TestState => "OH";
|
||||
public string TestCountry => "USA";
|
||||
public string TestZipCode => "44240";
|
||||
namespace Microsoft.eShopWeb.UnitTests.Builders;
|
||||
|
||||
public AddressBuilder()
|
||||
{
|
||||
_address = WithDefaultValues();
|
||||
}
|
||||
public Address Build()
|
||||
{
|
||||
return _address;
|
||||
}
|
||||
public Address WithDefaultValues()
|
||||
{
|
||||
_address = new Address(TestStreet, TestCity, TestState, TestCountry, TestZipCode);
|
||||
return _address;
|
||||
}
|
||||
public class AddressBuilder
|
||||
{
|
||||
private Address _address;
|
||||
public string TestStreet => "123 Main St.";
|
||||
public string TestCity => "Kent";
|
||||
public string TestState => "OH";
|
||||
public string TestCountry => "USA";
|
||||
public string TestZipCode => "44240";
|
||||
|
||||
public AddressBuilder()
|
||||
{
|
||||
_address = WithDefaultValues();
|
||||
}
|
||||
public Address Build()
|
||||
{
|
||||
return _address;
|
||||
}
|
||||
public Address WithDefaultValues()
|
||||
{
|
||||
_address = new Address(TestStreet, TestCity, TestState, TestCountry, TestZipCode);
|
||||
return _address;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +1,39 @@
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
|
||||
using Moq;
|
||||
|
||||
namespace Microsoft.eShopWeb.UnitTests.Builders
|
||||
namespace Microsoft.eShopWeb.UnitTests.Builders;
|
||||
|
||||
public class BasketBuilder
|
||||
{
|
||||
public class BasketBuilder
|
||||
private Basket _basket;
|
||||
public string BasketBuyerId => "testbuyerId@test.com";
|
||||
|
||||
public int BasketId => 1;
|
||||
|
||||
public BasketBuilder()
|
||||
{
|
||||
private Basket _basket;
|
||||
public string BasketBuyerId => "testbuyerId@test.com";
|
||||
_basket = WithNoItems();
|
||||
}
|
||||
|
||||
public int BasketId => 1;
|
||||
public Basket Build()
|
||||
{
|
||||
return _basket;
|
||||
}
|
||||
|
||||
public BasketBuilder()
|
||||
{
|
||||
_basket = WithNoItems();
|
||||
}
|
||||
public Basket WithNoItems()
|
||||
{
|
||||
var basketMock = new Mock<Basket>(BasketBuyerId);
|
||||
basketMock.SetupGet(s => s.Id).Returns(BasketId);
|
||||
|
||||
public Basket Build()
|
||||
{
|
||||
return _basket;
|
||||
}
|
||||
_basket = basketMock.Object;
|
||||
return _basket;
|
||||
}
|
||||
|
||||
public Basket WithNoItems()
|
||||
{
|
||||
var basketMock = new Mock<Basket>(BasketBuyerId);
|
||||
basketMock.SetupGet(s => s.Id).Returns(BasketId);
|
||||
|
||||
_basket = basketMock.Object;
|
||||
return _basket;
|
||||
}
|
||||
|
||||
public Basket WithOneBasketItem()
|
||||
{
|
||||
var basketMock = new Mock<Basket>(BasketBuyerId);
|
||||
_basket = basketMock.Object;
|
||||
_basket.AddItem(2, 3.40m, 4);
|
||||
return _basket;
|
||||
}
|
||||
public Basket WithOneBasketItem()
|
||||
{
|
||||
var basketMock = new Mock<Basket>(BasketBuyerId);
|
||||
_basket = basketMock.Object;
|
||||
_basket.AddItem(2, 3.40m, 4);
|
||||
return _basket;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,47 @@
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
|
||||
|
||||
namespace Microsoft.eShopWeb.UnitTests.Builders
|
||||
namespace Microsoft.eShopWeb.UnitTests.Builders;
|
||||
|
||||
public class OrderBuilder
|
||||
{
|
||||
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()
|
||||
{
|
||||
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; }
|
||||
TestCatalogItemOrdered = new CatalogItemOrdered(TestCatalogItemId, TestProductName, TestPictureUri);
|
||||
_order = WithDefaultValues();
|
||||
}
|
||||
|
||||
public OrderBuilder()
|
||||
{
|
||||
TestCatalogItemOrdered = new CatalogItemOrdered(TestCatalogItemId, TestProductName, TestPictureUri);
|
||||
_order = WithDefaultValues();
|
||||
}
|
||||
public Order Build()
|
||||
{
|
||||
return _order;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
public Order WithNoItems()
|
||||
{
|
||||
_order = new Order(TestBuyerId, new AddressBuilder().WithDefaultValues(), new List<OrderItem>());
|
||||
return _order;
|
||||
}
|
||||
|
||||
public Order WithNoItems()
|
||||
{
|
||||
_order = new Order(TestBuyerId, new AddressBuilder().WithDefaultValues(), new List<OrderItem>());
|
||||
return _order;
|
||||
}
|
||||
|
||||
public Order WithItems(List<OrderItem> items)
|
||||
{
|
||||
_order = new Order(TestBuyerId, new AddressBuilder().WithDefaultValues(), items);
|
||||
return _order;
|
||||
}
|
||||
public Order WithItems(List<OrderItem> items)
|
||||
{
|
||||
_order = new Order(TestBuyerId, new AddressBuilder().WithDefaultValues(), items);
|
||||
return _order;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user