Example #1
0
        private IShopManager GetTestShopManager()
        {
            var mock = new Mock <IShopManager>();

            var opts = new ShopManagerOptions()
            {
                Image = new ImageOptions()
                {
                    SaveFormat     = ImageFormat.Jpeg,
                    EncoderQuality = 80L,
                    MaxWidth       = 1000,
                    MaxHeight      = 1000,
                    MaxThumbWidth  = 150,
                    MaxThumbHeight = 150,
                }
            };

            mock.Setup(x => x.Options).Returns(opts);
            mock.Setup(x => x.ErrorDescriber).Returns(new OperationErrorDescriber());
            return(mock.Object);
        }
Example #2
0
 public ShopImageTransformer(IOptions <ShopManagerOptions> optionsAccessor)
 {
     Options = optionsAccessor.Value ?? throw new ArgumentNullException(nameof(Options));
 }