BitmapOperationsTests.cs 795 B

123456789101112131415161718192021222324252627282930313233
  1. using NUnit.Framework;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using System.Windows.Media.Imaging;
  6. namespace PixiEditorTests.PerformanceTests
  7. {
  8. [TestFixture]
  9. public class BitmapOperationsTests
  10. {
  11. [TestCase(16,16)]
  12. [TestCase(128, 128)]
  13. [TestCase(512, 512)]
  14. [TestCase(1024, 1024)]
  15. [TestCase(2046, 2046)]
  16. [TestCase(4096, 4096)]
  17. public void FillBitmapWithPixelsTest(int width, int height)
  18. {
  19. WriteableBitmap bitmap = BitmapFactory.New(width, height);
  20. bitmap.Lock();
  21. for (int i = 0; i < width * height; i++)
  22. {
  23. bitmap.SetPixeli(i, 0xFFFFF);
  24. }
  25. bitmap.Unlock();
  26. Assert.Pass();
  27. }
  28. }
  29. }