Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

899 B
Raw Blame
using Grand.Business.Catalog.Queries.Handlers;
using Grand.Business.Core.Queries.Catalog;
using Grand.Data;
using Grand.Domain.Catalog;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace Grand.Business.Catalog.Tests.Queries.Handlers;

[TestClass]
public class GetProductArchByIdQueryHandlerTests
{
    private Mock<IRepository<ProductDeleted>> _productDeletedRepository;

    private GetProductArchByIdQueryHandler handler;

    [TestInitialize]
    public void Init()
    {
        _productDeletedRepository = new Mock<IRepository<ProductDeleted>>();

        handler = new GetProductArchByIdQueryHandler(_productDeletedRepository.Object);
    }

    [TestMethod]
    public async Task HandleTest()
    {
        //Act
        var result = await handler.Handle(new GetProductArchByIdQuery(), CancellationToken.None);
        //Assert
        Assert.IsNull(result);
    }
}