using qdr.fnd.core.pqueue.Storages;
using qdr.fnd.core.pqueue.test.Mocks;
using qdr.fnd.core.pqueue.test.Storages.Mocks;

namespace qdr.fnd.core.pqueue.test.Storages
{
    public class BaseStorageProviderTest
    {
        private LoggerMock _logger;
        
        
        [Test(TestOf=typeof(BaseStorageProvider))]
        public void CreateItemOk()
        {
            var provider = new BaseStorageProviderMock(_logger);
            var itemId = provider.CreateItem("own", "own-ref", "prv-class", 10, null);
            itemId = provider.CreateItem("own", "own-ref", "prv-class", 10, DateTime.Now);
            Assert.That(itemId, Is.EqualTo(BaseStorageProviderMock.TestId));
        }

        [Test(TestOf=typeof(BaseStorageProvider))]
        public void CreateItemFail()
        {
            var provider = new BaseStorageProviderMock(_logger);
            Assert.Throws<ArgumentNullException>(()=>provider.CreateItem(string.Empty, "own-ref", "prv-class", 10, null));
            Assert.Throws<ArgumentNullException>(()=>provider.CreateItem("own", string.Empty, "prv-class", 10, null));
            Assert.Throws<ArgumentNullException>(()=>provider.CreateItem("own", "own-ref", string.Empty, 10, null));
        }
    }
}
