本文整理匯總了C#中Block.RotateRight方法的典型用法代碼示例。如果您正苦於以下問題:C# Block.RotateRight方法的具體用法?C# Block.RotateRight怎麽用?C# Block.RotateRight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Block
的用法示例。
在下文中一共展示了Block.RotateRight方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RotateRight_clampsRotationSteps
public void RotateRight_clampsRotationSteps()
{
//arrange
b = new Block(shape, Color.White);
b.RotationSteps = 0;
//act
b.RotateRight();
// assert
Assert.AreEqual(3, b.RotationSteps);
}
示例2: RotateRight_decrementsRotationSteps
public void RotateRight_decrementsRotationSteps()
{
//arrange
b = new Block(shape, Color.White);
b.RotationSteps = 3;
//act
b.RotateRight();
// assert
Assert.AreEqual(2, b.RotationSteps);
}
示例3: RotateRight_swapsHeightAndWidth
public void RotateRight_swapsHeightAndWidth()
{
//arrange
b = new Block(shape, Color.White);
//act
b.RotateRight();
// assert
/* If my .Net-fu were a little more awesome, I would have
created a mock with an expectation of SwapHeightAndWidth()
being called */
Assert.AreEqual(3, b.CurrentHeight);
Assert.AreEqual(2, b.CurrentWidth);
}