Exemplo n.º 1
0
        public void UpdaterTest()
        {
            SpriteBatch sb = MockedSB;

            UnitTestSprite[] spritestart = new UnitTestSprite[25];

            //Initialize array
            for (int i = 0; i < spritestart.Length; i++)
            {
                spritestart[i] = new UnitTestSprite();
                Assert.IsFalse(spritestart[i].IsUpdated);
                Assert.IsFalse(spritestart[i].IsDrawn);
            }
            SpriteWrapper   target  = new SpriteWrapper(sb, spritestart);
            UnitTestUpdater updater = new UnitTestUpdater(target);

            target.Updater = updater;
            Assert.AreEqual(target.Sprites, updater.AllSprites);
            target.Update();
            Assert.AreEqual(updater.UpdatedSprites, spritestart.Length);
            for (int i = 0; i < spritestart.Length; i++)
            {
                Assert.IsTrue(spritestart[i].IsUpdated);
                Assert.IsFalse(spritestart[i].IsDrawn);
            }
        }
Exemplo n.º 2
0
        public void UpdateTest()
        {
            //SpriteBatch sb = new SpriteBatch(new GraphicsDevice(GraphicsAdapter.DefaultAdapter, GraphicsProfile.HiDef, new PresentationParameters() { DeviceWindowHandle = GraphicsAdapter.DefaultAdapter.MonitorHandle } ));
            SpriteBatch sb = MockedSB;

            UnitTestSprite[] spritestart = new UnitTestSprite[25];

            //Initialize array
            for (int i = 0; i < spritestart.Length; i++)
            {
                spritestart[i] = new UnitTestSprite();
                Assert.IsFalse(spritestart[i].IsUpdated);
                Assert.IsFalse(spritestart[i].IsDrawn);
            }
            SpriteWrapper target = new SpriteWrapper(sb, spritestart);

            target.Update();
            Assert.IsNull(target.Updater);
            for (int i = 0; i < spritestart.Length; i++)
            {
                Assert.IsTrue(spritestart[i].IsUpdated);
                Assert.IsFalse(spritestart[i].IsDrawn);
            }
        }
Exemplo n.º 3
0
        public void UpdaterTest()
        {
            SpriteBatch sb = MockedSB;
            UnitTestSprite[] spritestart = new UnitTestSprite[25];

            //Initialize array
            for (int i = 0; i < spritestart.Length; i++)
            {
                spritestart[i] = new UnitTestSprite();
                Assert.IsFalse(spritestart[i].IsUpdated);
                Assert.IsFalse(spritestart[i].IsDrawn);
            }
            SpriteWrapper target = new SpriteWrapper(sb, spritestart);
            UnitTestUpdater updater = new UnitTestUpdater(target);
            target.Updater = updater;
            Assert.AreEqual(target.Sprites, updater.AllSprites);
            target.Update();
            Assert.AreEqual(updater.UpdatedSprites, spritestart.Length);
            for (int i = 0; i < spritestart.Length; i++)
            {
                Assert.IsTrue(spritestart[i].IsUpdated);
                Assert.IsFalse(spritestart[i].IsDrawn);
            }
        }
Exemplo n.º 4
0
        public void UpdateTest()
        {
            //SpriteBatch sb = new SpriteBatch(new GraphicsDevice(GraphicsAdapter.DefaultAdapter, GraphicsProfile.HiDef, new PresentationParameters() { DeviceWindowHandle = GraphicsAdapter.DefaultAdapter.MonitorHandle } ));
            SpriteBatch sb = MockedSB;
            UnitTestSprite[] spritestart = new UnitTestSprite[25];

            //Initialize array
            for (int i = 0; i < spritestart.Length; i++)
            {
                spritestart[i] = new UnitTestSprite();
                Assert.IsFalse(spritestart[i].IsUpdated);
                Assert.IsFalse(spritestart[i].IsDrawn);
            }
            SpriteWrapper target = new SpriteWrapper(sb, spritestart);
            target.Update();
            Assert.IsNull(target.Updater);
            for (int i = 0; i < spritestart.Length; i++)
            {
                Assert.IsTrue(spritestart[i].IsUpdated);
                Assert.IsFalse(spritestart[i].IsDrawn);
            }
        }