Minor refactoring and Unit Test fix

This commit is contained in:
CESARDELATORRE 2017-01-26 15:08:51 -08:00
parent 92cd474d34
commit fa6a273a33
3 changed files with 17 additions and 14 deletions

View File

@ -52,7 +52,9 @@
{
options.UseSqlServer(Configuration["ConnectionString"],
sqlop => sqlop.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name));
});
},
ServiceLifetime.Scoped
);
services.AddSwaggerGen();
services.ConfigureSwaggerGen(options =>

View File

@ -13,6 +13,14 @@
{
private readonly OrderingContext _context;
public IUnitOfWork UnitOfWork
{
get
{
return _context;
}
}
public BuyerRepository(OrderingContext context)
{
if (context == null)
@ -23,14 +31,6 @@
_context = context;
}
public IUnitOfWork UnitOfWork
{
get
{
return _context;
}
}
public Buyer Add(Buyer buyer)
{
return _context.Buyers

View File

@ -2,7 +2,8 @@
{
using Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Commands;
using Microsoft.eShopOnContainers.Services.Ordering.Domain;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Repositories;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
using Moq;
using System;
using System.Threading;