public void BitmapEditor_GetExtensions_InvokeDefault_ReturnsExpected() { var editor = new SubBitmapEditor(); string[] extensions = editor.GetExtensions(); Assert.Equal(new string[] { "bmp", "gif", "jpg", "jpeg", "png", "ico" }, extensions); Assert.NotSame(extensions, editor.GetExtensions()); }
public void BitmapEditor_BitmapExtensions_Get_ReturnsExpected() { var editor = new SubBitmapEditor(); List <string> extensions = SubBitmapEditor.BitmapExtensions; Assert.Equal(new string[] { "bmp", "gif", "jpg", "jpeg", "png", "ico" }, extensions); Assert.Same(extensions, SubBitmapEditor.BitmapExtensions); }
public void BitmapEditor_LoadFromStream_MetafileStream_ReturnsExpected() { var editor = new SubBitmapEditor(); using (Stream stream = File.OpenRead("Resources/telescope_01.wmf")) { Bitmap result = Assert.IsType <Bitmap>(editor.LoadFromStream(stream)); Assert.Equal(new Size(490, 654), result.Size); } }
public void BitmapEditor_LoadFromStream_BitmapStream_ReturnsExpected() { var editor = new SubBitmapEditor(); using (MemoryStream stream = new MemoryStream()) using (var image = new Bitmap(10, 10)) { image.Save(stream, ImageFormat.Bmp); stream.Position = 0; Bitmap result = Assert.IsType <Bitmap>(editor.LoadFromStream(stream)); Assert.Equal(new Size(10, 10), result.Size); } }
public void BitmapEditor_GetFileDialogDescription_Invoke_ReturnsExpected() { var editor = new SubBitmapEditor(); Assert.Equal("Bitmap files", editor.GetFileDialogDescription()); }
public void BitmapEditor_LoadFromStream_NullStream_ThrowsArgumentNullException() { var editor = new SubBitmapEditor(); Assert.Throws <ArgumentNullException>("stream", () => editor.LoadFromStream(null)); }