本文整理汇总了C#中Result.CalculateResult方法的典型用法代码示例。如果您正苦于以下问题:C# Result.CalculateResult方法的具体用法?C# Result.CalculateResult怎么用?C# Result.CalculateResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result.CalculateResult方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateResult_ResultShouldBeHighestCard
public void CalculateResult_ResultShouldBeHighestCard()
{
CardValue firstCard = new CardValue(cardValues[0] + "_of_" + cardTypes[0]);
CardValue secondCard = new CardValue(cardValues[5] + "_of_" + cardTypes[2]);
CardValue thirdCard = new CardValue(cardValues[3] + "_of_" + cardTypes[3]);
CardValue fourthCard = new CardValue(cardValues[8] + "_of_" + cardTypes[1]);
CardValue fifthCard = new CardValue(cardValues[10] + "_of_" + cardTypes[0]);
CardValue sixthCard = new CardValue(cardValues[1] + "_of_" + cardTypes[2]);
CardValue seventhCard = new CardValue(cardValues[9] + "_of_" + cardTypes[3]);
Result result = new Result(new CardValue[]{firstCard, secondCard}, new CardValue[]{thirdCard, fourthCard, fifthCard, sixthCard, seventhCard});
result.CalculateResult();
Assert.AreEqual((int) PlayerResult.HighestCard, result.ResultIndex);
}
示例2: CalculateResult_ResultShouldBeFlushWithHighestValueQueen
public void CalculateResult_ResultShouldBeFlushWithHighestValueQueen()
{
CardValue firstCard = new CardValue(cardValues[10] + "_of_" + cardTypes[0]);
CardValue secondCard = new CardValue(cardValues[5] + "_of_" + cardTypes[0]);
CardValue thirdCard = new CardValue(cardValues[2] + "_of_" + cardTypes[3]);
CardValue fourthCard = new CardValue(cardValues[8] + "_of_" + cardTypes[0]);
CardValue fifthCard = new CardValue(cardValues[2] + "_of_" + cardTypes[0]);
CardValue sixthCard = new CardValue(cardValues[12] + "_of_" + cardTypes[2]);
CardValue seventhCard = new CardValue(cardValues[9] + "_of_" + cardTypes[0]);
Result result = new Result(new CardValue[]{firstCard, secondCard}, new CardValue[]{thirdCard, fourthCard, fifthCard, sixthCard, seventhCard});
result.CalculateResult();
Assert.AreEqual(firstCard, result.PlayerHand[0]);
}