Пример #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);
            }
        }
Пример #2
0
        public void SpriteWrapperConstructorTest()
        {
            ICollection<ISprite> spritestart = new ISprite[3]; // TODO: Initialize to an appropriate value
            SpriteBatch sb = MockedSB; // TODO: Initialize to an appropriate value
            Updater updates = new UnitTestUpdater(null); // TODO: Initialize to an appropriate value
            SpriteWrapper target = new SpriteWrapper(spritestart, sb, updates);
            Assert.AreEqual<Updater>(updates, target.Updater);

            Assert.AreEqual(spritestart.Count, target.Sprites.Count);
        }
Пример #3
0
        public void SpriteWrapperConstructorTest()
        {
            ICollection <ISprite> spritestart = new ISprite[3];            // TODO: Initialize to an appropriate value
            SpriteBatch           sb          = MockedSB;                  // TODO: Initialize to an appropriate value
            Updater       updates             = new UnitTestUpdater(null); // TODO: Initialize to an appropriate value
            SpriteWrapper target = new SpriteWrapper(spritestart, sb, updates);

            Assert.AreEqual <Updater>(updates, target.Updater);

            Assert.AreEqual(spritestart.Count, target.Sprites.Count);
        }
Пример #4
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);
            }
        }