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)); }