public void MetafileEditor_GetExtensions_InvokeDefault_ReturnsExpected() { var editor = new SubMetafileEditor(); string[] extensions = editor.GetExtensions(); Assert.Equal(new string[] { "emf", "wmf" }, extensions); Assert.NotSame(extensions, editor.GetExtensions()); }
public void MetafileEditor_LoadFromStream_MetafileStream_ReturnsExpected() { var editor = new SubMetafileEditor(); using (Stream stream = File.OpenRead("Resources/telescope_01.wmf")) { Metafile result = Assert.IsType <Metafile>(editor.LoadFromStream(stream)); Assert.Equal(new Size(3096, 4127), result.Size); } }
public void MetafileEditor_LoadFromStream_BitmapStream_ThrowsExternalException() { var editor = new SubMetafileEditor(); using (MemoryStream stream = new MemoryStream()) using (var image = new Bitmap(10, 10)) { image.Save(stream, ImageFormat.Bmp); stream.Position = 0; Assert.Throws <ExternalException>(() => editor.LoadFromStream(stream)); } }
public void MetafileEditor_LoadFromStream_NullStream_ThrowsArgumentNullException() { var editor = new SubMetafileEditor(); Assert.Throws <ArgumentNullException>("stream", () => editor.LoadFromStream(null)); }
public void MetafileEditor_GetFileDialogDescription_Invoke_ReturnsExpected() { var editor = new SubMetafileEditor(); Assert.Equal("Metafiles", editor.GetFileDialogDescription()); }