本文整理汇总了C#中Deck.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Deck.Equals方法的具体用法?C# Deck.Equals怎么用?C# Deck.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deck
的用法示例。
在下文中一共展示了Deck.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decks_with_same_seed_generate_equal_decks
public void Decks_with_same_seed_generate_equal_decks()
{
// Arrange.
var seed = Environment.TickCount;
var sut = new Deck();
var other = new Deck();
// Act.
sut.Shuffle(seed);
other.Shuffle(seed);
// Assert.
Assert.That(sut.Equals(other), Is.True);
}
示例2: Decks_with_different_seed_does_not_generate_equal_decks
public void Decks_with_different_seed_does_not_generate_equal_decks()
{
// Arrange.
var seed = Environment.TickCount;
var sut = new Deck();
var other = new Deck();
// Act.
sut.Shuffle(seed);
other.Shuffle(seed + 1);
// Assert.
Assert.That(sut.Equals(other), Is.False);
}
示例3: RunTests
public static void RunTests()
{
Console.WriteLine("Testing the Deck class");
Deck d = new Deck();
Deck dc = d.Clone();
for (int i = 0; i < 20; i++)
{
d.shuffle();
Console.WriteLine("Shuffle {0}:", i + 1);
Console.WriteLine("Original:" + Environment.NewLine + dc.ToString());
Console.WriteLine("Shuffled:" + Environment.NewLine + d.ToString());
Console.WriteLine("Returned to original order: {0}", d.Equals(dc));
Console.WriteLine("-----------------------");
if (d.Equals(dc))
{
return;
}
}
}