Exemplo n.º 1
0
 public void CreateZoomingEffect()
 {
     var resolver = new TestResolver();
     var content = resolver.Resolve<Content>();
     var effect = new ZoomingEffect(content.Load<Image>("test"), Rectangle.Zero, Rectangle.One);
     Assert.AreEqual(Point.Zero, effect.DrawArea.Center);
 }
Exemplo n.º 2
0
 public void EmulateRunZoomingEffectForOneSecondToBeRemoved()
 {
     Start(typeof(TestResolver), (Content content, Renderer renderer) =>
     {
         var effect = new ZoomingEffect(content.Load<Image>("test"), Rectangle.Zero, Rectangle.One);
         renderer.Add(effect);
         Assert.AreEqual(1, renderer.NumberOfActiveRenderableObjects);
         testResolver.AdvanceTimeAndExecuteRunners(0.5f);
         Assert.AreEqual(0.25f, effect.DrawArea.Center.X, 0.1f);
         Assert.AreEqual(0.25f, effect.DrawArea.Center.Y, 0.1f);
         testResolver.AdvanceTimeAndExecuteRunners(1.0f);
         Assert.AreEqual(0.5f, effect.DrawArea.Center.X, 0.1f);
         Assert.AreEqual(0.5f, effect.DrawArea.Center.Y, 0.1f);
         Assert.AreEqual(0, renderer.NumberOfActiveRenderableObjects);
     });
 }