示例#1
0
        protected void GetImagesForBookReturnsCorrectImage(string imageType)
        {
            Expect.Call(requestHelper.GetResponse(null)).
            IgnoreArguments().
            Constraints(Is.TypeOf <List <string> >()).
            Return(docBookNormal);
            mocks.ReplayAll();

            IImageService imageService = new AWSImageService(requestHelper);

            IDictionary <string, Image> images = imageService.GetImagesForBook(book);
            Image image = images[imageType];

            Assert.AreEqual(testImagesBook[imageType], image);
        }
示例#2
0
        public void GetImagesForBookReturnsOnlyLargeImage()
        {
            Expect.Call(requestHelper.GetResponse(null)).
            IgnoreArguments().
            Constraints(Is.TypeOf <List <string> >()).
            Return(docBookOnlyLargeImage);
            mocks.ReplayAll();

            IImageService imageService = new AWSImageService(requestHelper);

            IDictionary <string, Image> images = imageService.GetImagesForBook(book);

            Assert.IsNull(images[AWSImageService.SWATCHIMAGE]);
            Assert.IsNull(images[AWSImageService.SMALLIMAGE]);
            Assert.IsNull(images[AWSImageService.THUMBNAILIMAGE]);
            Assert.IsNull(images[AWSImageService.TINYIMAGE]);
            Assert.IsNull(images[AWSImageService.MEDIUMIMAGE]);
            Assert.IsNotNull(images[AWSImageService.LARGEIMAGE]);
        }