public void TestBlockColor() { RedBlock red = new RedBlock(0, 0); GreenBlock green = new GreenBlock(0, 0); BlueBlock blue = new BlueBlock(0, 0); YellowBlock yellow = new YellowBlock(0, 20); Assert.AreEqual(Color.Yellow, yellow.Color); Assert.AreEqual(Color.Red, red.Color); Assert.AreEqual(Color.Blue, blue.Color); Assert.AreEqual(Color.Green, green.Color); }
public void TestBlockIsAtWhenMoved() { GreenBlock g = new GreenBlock(0, 0); Assert.IsTrue(g.IsAt(SwinGame.PointAt(50, 50))); Assert.IsTrue(g.IsAt(SwinGame.PointAt(25, 25))); Assert.IsFalse(g.IsAt(SwinGame.PointAt(70, 50))); Assert.IsFalse(g.IsAt(SwinGame.PointAt(50, 70))); g.X = 100; g.Y = 100; Assert.IsTrue(g.IsAt(SwinGame.PointAt(110, 110))); Assert.IsTrue(g.IsAt(SwinGame.PointAt(120, 120))); Assert.IsFalse(g.IsAt(SwinGame.PointAt(25, 50))); Assert.IsFalse(g.IsAt(SwinGame.PointAt(50, 25))); }