订单微服务实体实现

This commit is contained in:
administrator committed 2024-08-29 23:07:14 +08:00
1 parent b0b9491dfe
commit 2201f36422
69 files changed
+1042 -67

No files matched your search

@@ -3,7 +3,9 @@
using AutoMapper;
using HelloShop.ProductService.AutoMapper;
using HelloShop.ProductService.Controllers;
using HelloShop.ProductService.Entities.Products;
using HelloShop.ProductService.Infrastructure;
using HelloShop.ProductService.Models.Products;
using HelloShop.ProductService.UnitTests.Utilities;
using Microsoft.AspNetCore.Mvc;
@@ -16,7 +18,7 @@ namespace HelloShop.ProductService.UnitTests
public async Task GetProductByIdReturnsProductDetailsResponse()
{
// Arrange
await using EntityFrameworks.ProductServiceDbContext dbContext = new FakeDbContextFactory().CreateDbContext();
await using ProductServiceDbContext dbContext = new FakeDbContextFactory().CreateDbContext();
await dbContext.AddAsync(new Product { Id = 1, Name = "Product 1", Price = 10 });
@@ -40,7 +42,7 @@ namespace HelloShop.ProductService.UnitTests
public async Task PostProductReturnsProductDetailsResponse(string productName, decimal price)
{
// Arrange
await using EntityFrameworks.ProductServiceDbContext dbContext = new FakeDbContextFactory().CreateDbContext();
await using ProductServiceDbContext dbContext = new FakeDbContextFactory().CreateDbContext();
IMapper mapper = new MapperConfiguration(configure => configure.AddProfile<ProductsMapConfiguration>()).CreateMapper();