IsValid() private method

private IsValid ( SafeUri uri, Pixbuf pixbuf ) : bool
uri SafeUri
pixbuf Pixbuf
return bool
Esempio n. 1
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);
		}
Esempio n. 2
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);
		}
Esempio n. 3
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);
		}
Esempio n. 4
0
		// Analysis disable once InconsistentNaming
		public void IsValid_ReturnsFalse_IfPixbufIsNull ()
		{
			var fileSystem = new FileSystemMock ();
			fileSystem.SetFile (fileUri, fileMTime);
			var thumbnailService = new ThumbnailService (xdgDirectoryService, thumbnailerFactory, fileSystem);

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

			Assert.IsFalse (result);
		}