Beispiel #1
0
 public void _13_ShouldTurnRightWhenHittingLeftSideOfCanvas()
 {
     _beetleX = (_beetleSize / 2) + 1; // 1 pixel from left side
     BeetleHelper.SetXProperty(_beetleObject, _beetleX);
     BeetleHelper.SetRightProperty(_beetleObject, false);
     BeetleHelper.SetUpProperty(_beetleObject, false);
     AssertAndInvokeChangePositionMethod(_beetleObject);
     AssertPropertyValue(_beetleObject, BeetleHelper.XProperty, _beetleX - 1); // should go left
     AssertPropertyValue(_beetleObject, BeetleHelper.YProperty, _beetleY + 1); // should go down
     AssertPropertyValue(_beetleObject, BeetleHelper.RightProperty, true);
     AssertPropertyValue(_beetleObject, BeetleHelper.UpProperty, false);
 }
Beispiel #2
0
 public void _12_ShouldTurnLeftWhenHittingRightSideOfCanvas()
 {
     _beetleX = TestCanvasWidth - (_beetleSize / 2) - 1; // 1 pixel from right side
     BeetleHelper.SetXProperty(_beetleObject, _beetleX);
     BeetleHelper.SetRightProperty(_beetleObject, true);
     BeetleHelper.SetUpProperty(_beetleObject, false);
     AssertAndInvokeChangePositionMethod(_beetleObject);
     AssertPropertyValue(_beetleObject, BeetleHelper.XProperty, _beetleX + 1); // should go right
     AssertPropertyValue(_beetleObject, BeetleHelper.YProperty, _beetleY + 1); // should go down
     AssertPropertyValue(_beetleObject, BeetleHelper.RightProperty, false);
     AssertPropertyValue(_beetleObject, BeetleHelper.UpProperty, false);
 }