Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2941


Ignore:
Timestamp:
03/05/10 16:36:58 (15 years ago)
Author:
mkommend
Message:

added testcase for bitmap serializer (ticket #892)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/UnitTests/UseCases.cs

    r2939 r2941  
    1818using HeuristicLab.Persistence.Test;
    1919using System.Drawing;
     20using System.Drawing.Imaging;
    2021
    2122namespace HeuristicLab.Persistence.UnitTest {
     
    646647    }
    647648
     649    [TestMethod]
     650    public void BitmapTest() {
     651      Icon icon = System.Drawing.SystemIcons.Hand;
     652      Bitmap bitmap = icon.ToBitmap();
     653      XmlGenerator.Serialize(bitmap, tempFile);
     654      Bitmap newBitmap = (Bitmap)XmlParser.Deserialize(tempFile);
     655
     656      Assert.AreEqual(bitmap.Size, newBitmap.Size);
     657      for(int i=0; i< bitmap.Size.Width; i++)
     658        for(int j =0; j< bitmap.Size.Height; j++)
     659          Assert.AreEqual(bitmap.GetPixel(i,j),newBitmap.GetPixel(i,j));
     660    }
     661
    648662    [ClassInitialize]
    649663    public static void Initialize(TestContext testContext) {
Note: See TracChangeset for help on using the changeset viewer.