Ejemplo n.º 1
0
 public void _15_ShouldNotMoveWhenSpeedIsZero()
 {
     _beetleSpeed = 0;
     BeetleHelper.SetSpeedPropertyValue(_beetleObject, _beetleSpeed);
     AssertAndInvokeChangePositionMethod(_beetleObject);
     AssertPropertyValue(_beetleObject, BeetleHelper.XProperty, _beetleX); // should not move
     AssertPropertyValue(_beetleObject, BeetleHelper.YProperty, _beetleY); // should not move
 }
Ejemplo n.º 2
0
 public void Setup()
 {
     _testCanvas = new Canvas
     {
         Width  = TestCanvasWidth,
         Height = TestCanvasHeight
     };
     _beetleSize   = 10;
     _beetleX      = 40;
     _beetleY      = 35;
     _beetleSpeed  = 0.5;
     _beetleObject = BeetleHelper.CreateBeetle(_testCanvas, _beetleX, _beetleY, _beetleSize);
     if (_beetleObject != null)
     {
         BeetleHelper.SetSpeedPropertyValue(_beetleObject, _beetleSpeed);
     }
     _beetleEllipse = (_testCanvas.Children.Count > 0 ? _testCanvas.Children[0] as Ellipse : null);
 }