using qdr.fnd.core.pqueue.Configuration;
using qdr.fnd.core.pqueue.Enums;
using qdr.fnd.core.pqueue.Process;
using qdr.fnd.core.pqueue.Storages;
using Quadarax.Foundation.Core.Data;
using Quadarax.Foundation.Core.Logging;
using Quadarax.Foundation.Core.Thread;

namespace qdr.fnd.core.pqueue.test.Mocks
{
    internal class PsQueueMock : PsQueue
    {
       
        public IPsQueueStorage Storage => _storage;

        #region *** Constructors ***
        public PsQueueMock(string queueName, PsQueueConfiguration configuration, IPsQueueStorage storageProvider, ILogger logger) : base(queueName, configuration, storageProvider, logger)
        {
        }
        #endregion

        #region *** Test proxies ***
        public Task TestDoIteration(IWorkerContext? context)
        {
            return DoIteration(context);
        }

        public void TestValidateItemId(string itemId)
        {
            ValidateItemId(itemId);
        }
        public void TestValidateEmitter(string emitter)
        {
            ValidateEmitter(emitter);
        }
        public void TestValidateItem(IPsQueueItemDescriptor item)
        {
            ValidateItem(item);
        }
        public void TestSetItemStatusInternal(IPsQueueItem item, PsStatusEnum? newStatus, bool isTransient, string message)
        {
            SetItemStatusInternal(item, newStatus, isTransient, message);
        }
        public IPsProcessProvider TestResolveProvider(string itemId, string providerClass, IEnumerable<TypedArgument> arguments)
        {
            return ResolveProvider(itemId, providerClass, arguments);
        }
        public void TestEnsureItemStateExpired(IPsQueueItem item)
        {
            EnsureItemStateExpired(item);
        }
        public IPsQueueItem TestGetItemInternal(string itemId)
        {
            return GetItemInternal(itemId);
        }

        #endregion

    }
}
