Commit 99a704e6 authored by Michal Bilanin's avatar Michal Bilanin 🙄
Browse files

Merge branch 'feat/wishlist-gui' into 'master'

Feat/wishlist gui

See merge request !34
parents eab276d6 182c0872
Loading
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@ namespace BusinessLayer.Tests.Services;

public class AuditTrailServiceTests
{
    private IAuditTrailService _auditTrailService;
    private IRepository<Product> _productRepository;
    private IMapper _mapper;
    private readonly IAuditTrailService _auditTrailService;
    private readonly IMapper _mapper;
    private readonly IRepository<Product> _productRepository;

    public AuditTrailServiceTests()
    {
@@ -28,7 +28,8 @@ public class AuditTrailServiceTests
        _productRepository = new Repository<Product>(dbContext);
        var config = new MapperConfiguration(cfg => cfg.AddProfile<MapperProfileInstaller>());
        _mapper = config.CreateMapper();
        _auditTrailService = new AuditTrailService(auditTrailRepository, new QueryObject<AuditTrail>(dbContext), _mapper);
        _auditTrailService =
            new AuditTrailService(auditTrailRepository, new QueryObject<AuditTrail>(dbContext), _mapper);
    }

    [Fact]
@@ -50,7 +51,7 @@ public class AuditTrailServiceTests
        // Act
        var result = await _productRepository.CreateAsync(product, userId);

        var filter = new AuditTrailFilterDto()
        var filter = new AuditTrailFilterDto
        {
            EntityName = nameof(Product)
        };
+2 −4
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ using BusinessLayer.Services.Interfaces;
using JuiceWorld.Entities;
using JuiceWorld.Repositories;
using JuiceWorld.UnitOfWork;
using Microsoft.Extensions.Caching.Memory;
using TestUtilities.MockedObjects;
using Xunit;
using Assert = Xunit.Assert;
@@ -15,7 +14,7 @@ namespace BusinessLayer.Tests.Services;

public class CartItemServiceTests
{
    private ICartItemService _cartItemService;
    private readonly ICartItemService _cartItemService;

    public CartItemServiceTests()
    {
@@ -25,8 +24,7 @@ public class CartItemServiceTests
        var config = new MapperConfiguration(cfg => cfg.AddProfile<MapperProfileInstaller>());
        var mapper = config.CreateMapper();
        var orderUnitOfWork = new OrderUnitOfWork(dbContext);
        var memorycache = new MemoryCache(new MemoryCacheOptions());
        _cartItemService = new CartItemService(crtItemRepository, orderUnitOfWork, memorycache, mapper);
        _cartItemService = new CartItemService(crtItemRepository, orderUnitOfWork, mapper);
    }

    [Fact]
+4 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ namespace BusinessLayer.Tests.Services;

public class ManufacturerServiceTests
{
    private IManufacturerService _manufacturerService;
    private readonly IManufacturerService _manufacturerService;

    public ManufacturerServiceTests()
    {
@@ -41,7 +41,8 @@ public class ManufacturerServiceTests
        // Assert
        var manufacturerDtos = result.ToList();
        Assert.Equal(manufacturerIdsToRetrieve.Length, manufacturerDtos.Count);
        Assert.All(manufacturerIdsToRetrieve, id => Assert.Contains(manufacturerDtos, manufacturer => manufacturer.Id == id));
        Assert.All(manufacturerIdsToRetrieve,
            id => Assert.Contains(manufacturerDtos, manufacturer => manufacturer.Id == id));
    }

    [Fact]
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ namespace BusinessLayer.Tests.Services;

public class OrderServiceTests
{
    private IOrderService _orderService;
    private readonly IOrderService _orderService;

    public OrderServiceTests()
    {
+4 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ namespace BusinessLayer.Tests.Services;

public class ProductServiceTests
{
    private IProductService _productService;
    private readonly IProductService _productService;

    public ProductServiceTests()
    {
@@ -30,7 +30,8 @@ public class ProductServiceTests
        var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
        var cache = new MemoryCache(new MemoryCacheOptions());
        var unitOfwork = new ProductUnitOfWork(dbContext);
        _productService = new ProductService(productRepository, mapper, cache, new QueryObject<Product>(dbContext), unitOfwork);
        _productService = new ProductService(productRepository, mapper, cache, new QueryObject<Product>(dbContext),
            unitOfwork);
    }

    [Fact]
Loading