public void XAreaLessThanYArea()
 {
     Sprite x = new Sprite("X", new Bitmap(10, 20), 0, false);
     Sprite y = new Sprite("Y", new Bitmap(20, 30), 0, false);
     SpriteSizeComparer comparer = new SpriteSizeComparer();
     int expected = -1;
     int actual = comparer.Compare(x, y);
     Assert.AreEqual(expected, actual);
 }
 public void XAreaEqualToYAreaAndXLongestDimensionLessThanY()
 {
     Sprite x = new Sprite("X", new Bitmap(15, 20), 0, false);
     Sprite y = new Sprite("Y", new Bitmap(10, 30), 0, false);
     SpriteSizeComparer comparer = new SpriteSizeComparer();
     int expected = -1;
     int actual = comparer.Compare(x, y);
     Assert.AreEqual(expected, actual);
 }
Exemple #3
0
        public void XAreaEqualToYAreaAndXLongestDimensionEqualToY()
        {
            Sprite             x        = new Sprite("X", new Bitmap(10, 20), 0, false);
            Sprite             y        = new Sprite("Y", new Bitmap(10, 20), 0, false);
            SpriteSizeComparer comparer = new SpriteSizeComparer();
            int expected = 0;
            int actual   = comparer.Compare(x, y);

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void XAreaGreaterThanYArea()
        {
            Sprite             x        = new Sprite("X", new Bitmap(20, 30), 0, false);
            Sprite             y        = new Sprite("Y", new Bitmap(10, 20), 0, false);
            SpriteSizeComparer comparer = new SpriteSizeComparer();
            int expected = 1;
            int actual   = comparer.Compare(x, y);

            Assert.AreEqual(expected, actual);
        }