private LoadThumbnail ( SafeUri thumbnailUri ) : Pixbuf | ||
thumbnailUri | SafeUri | |
Résultat | Pixbuf |
// Analysis disable once InconsistentNaming public void LoadThumbnail_ReturnsPixbuf_IfThumbnailExists () { var fileSystem = new FileSystemMock (); fileSystem.SetFile (largeThumbnailUri, 0, thumbnail); var thumbnailService = new ThumbnailService (xdgDirectoryService, thumbnailerFactory, fileSystem); var result = thumbnailService.LoadThumbnail (largeThumbnailUri); Assert.IsNotNull (result); }
// Analysis disable once InconsistentNaming public void LoadThumbnail_IgnoresExceptionsOnDeletingThumbnails () { var fileSystem = new FileSystemMock (); fileSystem.SetFile (largeThumbnailUri, 0, thumbnail); fileSystem.FileMock.Setup (m => m.Read (largeThumbnailUri)).Throws<Exception> (); fileSystem.FileMock.Setup (m => m.Delete (largeThumbnailUri)).Throws<Exception> (); var thumbnailService = new ThumbnailService (xdgDirectoryService, thumbnailerFactory, fileSystem); var result = thumbnailService.LoadThumbnail (largeThumbnailUri); Assert.IsNull (result); fileSystem.FileMock.Verify (file => file.Delete (largeThumbnailUri), Times.Once ()); }
// Analysis disable once InconsistentNaming public void LoadThumbnail_ReturnsNull_IfThumbnailDoesNotExist () { var fileSystem = new FileSystemMock (); var thumbnailService = new ThumbnailService (xdgDirectoryService, thumbnailerFactory, fileSystem); var result = thumbnailService.LoadThumbnail (largeThumbnailUri); Assert.IsNull (result); }