public async void Name_Update_length()
        {
            Mock <IProductCategoryRepository> productCategoryRepository = new Mock <IProductCategoryRepository>();

            productCategoryRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new ProductCategory()));

            var validator = new ApiProductCategoryRequestModelValidator(productCategoryRepository.Object);
            await validator.ValidateUpdateAsync(default(int), new ApiProductCategoryRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.Name, new string('A', 51));
        }
        private async void BeUniqueByName_Create_Not_Exists()
        {
            Mock <IProductCategoryRepository> productCategoryRepository = new Mock <IProductCategoryRepository>();

            productCategoryRepository.Setup(x => x.ByName(It.IsAny <string>())).Returns(Task.FromResult <ProductCategory>(null));
            var validator = new ApiProductCategoryRequestModelValidator(productCategoryRepository.Object);

            await validator.ValidateCreateAsync(new ApiProductCategoryRequestModel());

            validator.ShouldNotHaveValidationErrorFor(x => x.Name, "A");
        }
        public async void Name_Create_null()
        {
            Mock <IProductCategoryRepository> productCategoryRepository = new Mock <IProductCategoryRepository>();

            productCategoryRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new ProductCategory()));

            var validator = new ApiProductCategoryRequestModelValidator(productCategoryRepository.Object);
            await validator.ValidateCreateAsync(new ApiProductCategoryRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.Name, null as string);
        }