Exemplo n.º 1
0
        // Analysis disable once InconsistentNaming
        public void IsValid_ReturnsFalse_IfFileDoesNotExist()
        {
            var fileSystem       = new FileSystemMock();
            var pixbuf           = PixbufMock.CreatePixbuf(fileUri, fileMTime + 1);
            var thumbnailService = new ThumbnailService(xdgDirectoryService, thumbnailerFactory, fileSystem);

            var result = thumbnailService.IsValid(fileUri, pixbuf);

            Assert.IsFalse(result);
        }
Exemplo n.º 2
0
        // Analysis disable once InconsistentNaming
        public void IsValid_ReturnsTrue_IfPixbufIsValid()
        {
            var fileSystem = new FileSystemMock();

            fileSystem.SetFile(fileUri, fileMTime);
            var pixbuf           = PixbufMock.CreatePixbuf(fileUri, fileMTime);
            var thumbnailService = new ThumbnailService(xdgDirectoryService, thumbnailerFactory, fileSystem);

            var result = thumbnailService.IsValid(fileUri, pixbuf);

            Assert.IsTrue(result);
        }
Exemplo n.º 3
0
        // Analysis disable once InconsistentNaming
        public void IsValid_ReturnsFalse_IfFileUriIsDifferent()
        {
            var fileSystem = new FileSystemMock();

            fileSystem.SetFile(fileUri, fileMTime);
            var pixbuf           = PixbufMock.CreatePixbuf(new SafeUri("file:///some-uri"), fileMTime);
            var thumbnailService = new ThumbnailService(xdgDirectoryService, thumbnailerFactory, fileSystem);

            var result = thumbnailService.IsValid(fileUri, pixbuf);

            Assert.IsFalse(result);
        }
Exemplo n.º 4
0
        // Analysis disable once InconsistentNaming
        public void IsValid_ReturnsFalse_IfMTimeIsDifferent()
        {
            var fileSystem = new FileSystemMock();

            fileSystem.SetFile(fileUri, fileLastWrite);
            var pixbuf           = PixbufMock.CreatePixbuf(fileUri, fileLastWrite.AddMilliseconds(1.0));
            var thumbnailService = new ThumbnailService(xdgDirectoryService, thumbnailerFactory, fileSystem);

            var result = thumbnailService.IsValid(fileUri, pixbuf);

            Assert.IsFalse(result);
        }