Beispiel #1
0
 public void TestFromExtension()
 {
     Assert.AreEqual(ImageFileKind.Bmp, ImageFileKind.FromExtension(".bmp"));
     Assert.AreEqual(ImageFileKind.Png, ImageFileKind.FromExtension("png"));
     Assert.AreEqual(ImageFileKind.Jpg, ImageFileKind.FromExtension(".jpg"));
     Assert.AreEqual(ImageFileKind.Jpg, ImageFileKind.FromExtension(".jpeg"));
     Assert.AreEqual(ImageFileKind.Gif, ImageFileKind.FromExtension("Gif"));
     Assert.AreEqual(ImageFileKind.Tif, ImageFileKind.FromExtension("TIF"));
     Assert.AreEqual(ImageFileKind.Tif, ImageFileKind.FromExtension(".TIFF"));
     Assert.AreEqual(ImageFileKind.Wmf, ImageFileKind.FromExtension(".Wmf"));
     Assert.AreEqual(ImageFileKind.Emf, ImageFileKind.FromExtension("emf"));
     Assert.AreEqual(ImageFileKind.Eps, ImageFileKind.FromExtension("eps"));
     Assert.AreEqual(ImageFileKind.Pdf, ImageFileKind.FromExtension(".pdf"));
     Assert.AreEqual(ImageFileKind.Powerpoint, ImageFileKind.FromExtension(".ppt"));
     Assert.AreEqual(ImageFileKind.Powerpoint, ImageFileKind.FromExtension(".pptx"));
 }
Beispiel #2
0
 public DestinationFile(string path)
 {
     this.ImageFileKind = ImageFileKind.FromExtension(System.IO.Path.GetExtension(path));
     this.Path          = path;
 }
Beispiel #3
0
 public void TestFromExtension_UnexpectedExtension()
 {
     Assert.ThrowsException <InvalidOperationException>(delegate { ImageFileKind.FromExtension(".txt"); });
 }