Пример #1
0
		public void TestFixtureSetup ()
		{
			var xdgDirectoryServiceMock = new Mock<IXdgDirectoryService> ();
			xdgDirectoryServiceMock.Setup (xdg => xdg.GetThumbnailsDir (ThumbnailSize.Large)).Returns (largeThumbnailPath);
			xdgDirectoryServiceMock.Setup (xdg => xdg.GetThumbnailsDir (ThumbnailSize.Normal)).Returns (normalThumbnailPath);
			xdgDirectoryService = xdgDirectoryServiceMock.Object;

			var thumbnailerFactoryMock = new Mock<IThumbnailerFactory> ();
			thumbnailerFactoryMock.Setup (factory => factory.GetThumbnailerForUri (fileUri)).Returns (thumbnailerMock.Object);
			thumbnailerFactory = thumbnailerFactoryMock.Object;
		}
Пример #2
0
        public void TestFixtureSetup()
        {
            var xdgDirectoryServiceMock = new Mock <IXdgDirectoryService> ();

            xdgDirectoryServiceMock.Setup(xdg => xdg.GetThumbnailsDir(ThumbnailSize.Large)).Returns(largeThumbnailPath);
            xdgDirectoryServiceMock.Setup(xdg => xdg.GetThumbnailsDir(ThumbnailSize.Normal)).Returns(normalThumbnailPath);
            xdgDirectoryService = xdgDirectoryServiceMock.Object;

            var thumbnailerFactoryMock = new Mock <IThumbnailerFactory> ();

            thumbnailerFactoryMock.Setup(factory => factory.GetThumbnailerForUri(fileUri)).Returns(thumbnailerMock.Object);
            thumbnailerFactory = thumbnailerFactoryMock.Object;
        }
Пример #3
0
		public ThumbnailService (IXdgDirectoryService xdgDirectoryService, IThumbnailerFactory thumbnailerFactory, IFileSystem fileSystem)
		{
			this.xdgDirectoryService = xdgDirectoryService;
			this.thumbnailerFactory = thumbnailerFactory;
			this.fileSystem = fileSystem;

			var large = new SafeUri(Path.Combine (xdgDirectoryService.GetThumbnailsDir (ThumbnailSize.Large)));
			if (!fileSystem.Directory.Exists (large))
				fileSystem.Directory.CreateDirectory (large);

			var normal = new SafeUri(Path.Combine (xdgDirectoryService.GetThumbnailsDir (ThumbnailSize.Normal)));
			if (!fileSystem.Directory.Exists (normal))
				fileSystem.Directory.CreateDirectory (normal);
		}
Пример #4
0
        public ThumbnailService(IXdgDirectoryService xdgDirectoryService, IThumbnailerFactory thumbnailerFactory, IFileSystem fileSystem)
        {
            this.xdgDirectoryService = xdgDirectoryService;
            this.thumbnailerFactory  = thumbnailerFactory;
            this.fileSystem          = fileSystem;

            var large = new Uri(Path.Combine(xdgDirectoryService.GetThumbnailsDir(ThumbnailSize.Large)));

            if (!fileSystem.Directory.Exists(large))
            {
                fileSystem.Directory.CreateDirectory(large);
            }

            var normal = new Uri(Path.Combine(xdgDirectoryService.GetThumbnailsDir(ThumbnailSize.Normal)));

            if (!fileSystem.Directory.Exists(normal))
            {
                fileSystem.Directory.CreateDirectory(normal);
            }
        }