Browse Source

Merge 02dac1c566 into b07677ae83

pull/121/merge
dsrodenas 7 years ago
committed by GitHub
parent
commit
19960b11d9
7 changed files with 13 additions and 13 deletions
  1. +3
    -3
      src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs
  2. +2
    -2
      src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs
  3. +1
    -1
      src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/IBuyerRepository.cs
  4. +1
    -1
      src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs
  5. +1
    -1
      src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs
  6. +1
    -1
      src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs
  7. +4
    -4
      test/Services/UnitTest/Ordering/Application/NewOrderCommandHandlerTest.cs

+ 3
- 3
src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs View File

@ -24,12 +24,12 @@
public class CreateOrderCommandHandler public class CreateOrderCommandHandler
: IAsyncRequestHandler<CreateOrderCommand, bool> : IAsyncRequestHandler<CreateOrderCommand, bool>
{ {
private readonly IBuyerRepository<Buyer> _buyerRepository;
private readonly IOrderRepository<Order> _orderRepository;
private readonly IBuyerRepository _buyerRepository;
private readonly IOrderRepository _orderRepository;
private readonly IIdentityService _identityService; private readonly IIdentityService _identityService;
// Using DI to inject infrastructure persistence Repositories // Using DI to inject infrastructure persistence Repositories
public CreateOrderCommandHandler(IBuyerRepository<Buyer> buyerRepository, IOrderRepository<Order> orderRepository, IIdentityService identityService)
public CreateOrderCommandHandler(IBuyerRepository buyerRepository, IOrderRepository orderRepository, IIdentityService identityService)
{ {
_buyerRepository = buyerRepository ?? throw new ArgumentNullException(nameof(buyerRepository)); _buyerRepository = buyerRepository ?? throw new ArgumentNullException(nameof(buyerRepository));
_orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository));


+ 2
- 2
src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs View File

@ -27,11 +27,11 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Autof
.InstancePerLifetimeScope(); .InstancePerLifetimeScope();
builder.RegisterType<BuyerRepository>() builder.RegisterType<BuyerRepository>()
.As<IBuyerRepository<Buyer>>()
.As<IBuyerRepository>()
.InstancePerLifetimeScope(); .InstancePerLifetimeScope();
builder.RegisterType<OrderRepository>() builder.RegisterType<OrderRepository>()
.As<IOrderRepository<Order>>()
.As<IOrderRepository>()
.InstancePerLifetimeScope(); .InstancePerLifetimeScope();
builder.RegisterType<RequestManager>() builder.RegisterType<RequestManager>()


+ 1
- 1
src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/IBuyerRepository.cs View File

@ -6,7 +6,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
//This is just the RepositoryContracts or Interface defined at the Domain Layer //This is just the RepositoryContracts or Interface defined at the Domain Layer
//as requisite for the Buyer Aggregate //as requisite for the Buyer Aggregate
public interface IBuyerRepository<T> : IRepository<T> where T : IAggregateRoot
public interface IBuyerRepository : IRepository<Buyer>
{ {
Buyer Add(Buyer buyer); Buyer Add(Buyer buyer);


+ 1
- 1
src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs View File

@ -5,7 +5,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
//This is just the RepositoryContracts or Interface defined at the Domain Layer //This is just the RepositoryContracts or Interface defined at the Domain Layer
//as requisite for the Order Aggregate //as requisite for the Order Aggregate
public interface IOrderRepository<T> : IRepository<T> where T : IAggregateRoot
public interface IOrderRepository : IRepository<Order>
{ {
Order Add(Order order); Order Add(Order order);
} }


+ 1
- 1
src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories
{ {
public class BuyerRepository public class BuyerRepository
: IBuyerRepository<Buyer>
: IBuyerRepository
{ {
private readonly OrderingContext _context; private readonly OrderingContext _context;


+ 1
- 1
src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories
{ {
public class OrderRepository public class OrderRepository
: IOrderRepository<Order>
: IOrderRepository
{ {
private readonly OrderingContext _context; private readonly OrderingContext _context;


+ 4
- 4
test/Services/UnitTest/Ordering/Application/NewOrderCommandHandlerTest.cs View File

@ -15,15 +15,15 @@ namespace UnitTest.Ordering.Application
using Xunit; using Xunit;
public class NewOrderRequestHandlerTest public class NewOrderRequestHandlerTest
{ {
private readonly Mock<IBuyerRepository<Buyer>> _buyerRepositoryMock;
private readonly Mock<IOrderRepository<Order>> _orderRepositoryMock;
private readonly Mock<IBuyerRepository> _buyerRepositoryMock;
private readonly Mock<IOrderRepository> _orderRepositoryMock;
private readonly Mock<IIdentityService> _identityServiceMock; private readonly Mock<IIdentityService> _identityServiceMock;
public NewOrderRequestHandlerTest() public NewOrderRequestHandlerTest()
{ {
_buyerRepositoryMock = new Mock<IBuyerRepository<Buyer>>();
_orderRepositoryMock = new Mock<IOrderRepository<Order>>();
_buyerRepositoryMock = new Mock<IBuyerRepository>();
_orderRepositoryMock = new Mock<IOrderRepository>();
_identityServiceMock = new Mock<IIdentityService>(); _identityServiceMock = new Mock<IIdentityService>();
} }


Loading…
Cancel
Save