using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using qdr.fnd.core.pqueue.Storages;
using Quadarax.Foundation.Core.Logging;

namespace qdr.fnd.core.pqueue.test.Storages.Mocks
{
    internal class BaseStorageProviderMock : BaseStorageProvider
    {
        public const string TestId = "TestId";
        public bool ReturnContainsItem { get; set; } = true;

        /// <inheritdoc />
        public BaseStorageProviderMock(ILogger? logger) : base(logger)
        {
        }

        #region Overrides of DisposableObject

        /// <inheritdoc />
        protected override void OnDisposing()
        {
        }

        #endregion

        #region Overrides of BaseStorageProvider

        /// <inheritdoc />
        protected override string OnCreateItem(string id, string owner, string ownerRef, string providerClass, int initialAttempts,
            DateTime created, string s)
        {
            return TestId;
        }

        /// <inheritdoc />
        protected override void OnDeleteItem(string itemId)
        {
        }

        /// <inheritdoc />
        public override bool ContainsItem(string itemId)
        {
            return ReturnContainsItem;
        }

        #endregion
    }
}
