public void ValidateStoreId_When_existing_store_Then_passes()
        {
            var validator = new ProductRequestCustomValidator();
            var errors    = new ArgumentErrorsCollection();

            var requestMock   = new Mock <ProductGetByIdRequest>();
            var dbContextMock = GetDbContextMock();

            requestMock.SetupGet(r => r.StoreId).Returns(10);

            validator.ValidateStoreId(dbContextMock.Object, requestMock.Object, errors);

            dbContextMock.VerifyGet(c => c.Stores, Times.Once);

            Assert.IsEmpty(errors);
        }
        public void ValidateStoreId_When_not_existing_store_Then_fails()
        {
            var validator = new ProductRequestCustomValidator();
            var errors = new ArgumentErrorsCollection();

            var requestMock = new Mock<ProductGetByIdRequest>();
            var dbContextMock = GetDbContextMock();

            requestMock.SetupGet(r => r.StoreId).Returns(20);

            validator.ValidateStoreId(dbContextMock.Object, requestMock.Object, errors);

            dbContextMock.VerifyGet(c => c.Stores, Times.Once);

            Assert.IsNotEmpty(errors);
            Assert.IsTrue(errors.HasArgument("StoreId"));
        }