本文整理汇总了C#中TestData.GetHeap方法的典型用法代码示例。如果您正苦于以下问题:C# TestData.GetHeap方法的具体用法?C# TestData.GetHeap怎么用?C# TestData.GetHeap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestData
的用法示例。
在下文中一共展示了TestData.GetHeap方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestPopReducesCountByOne
public void TestPopReducesCountByOne(TestData aData)
{
var heap = aData.GetHeap();
if (aData.ExpectedCount == 0)
{
Assert.Ignore();
}
heap.Pop();
Assert.That(heap.Count, Is.EqualTo(aData.ExpectedCount-1));
}
示例2: TestPopReturnsCorrectValue
public void TestPopReturnsCorrectValue(TestData aData)
{
var heap = aData.GetHeap();
if (aData.ExpectedCount == 0)
{
Assert.Ignore();
}
Assert.That(heap.Pop(), Is.EqualTo(aData.ExpectedMin));
}
示例3: TestPeekDoesntModifyCount
public void TestPeekDoesntModifyCount(TestData aData)
{
var heap = aData.GetHeap();
heap.Peek();
Assert.That(heap.Count, Is.EqualTo(aData.ExpectedCount));
}
示例4: TestPeekReturnsCorrectValue
public void TestPeekReturnsCorrectValue(TestData aData)
{
var heap = aData.GetHeap();
Assert.That(heap.Peek().Value, Is.EqualTo(aData.ExpectedMin));
}
示例5: TestInsertLowerValueAffectedMin
public void TestInsertLowerValueAffectedMin(TestData aData)
{
var heap = aData.GetHeap();
heap.Insert(aData.ExpectedMin - 1);
Assert.That(heap.Peek().Value, Is.EqualTo(aData.ExpectedMin - 1));
}
示例6: TestInsertIncreasedCountByOne
public void TestInsertIncreasedCountByOne(TestData aData)
{
var heap = aData.GetHeap();
heap.Insert(aData.ExpectedMin - 1);
Assert.That(heap.Count, Is.EqualTo(aData.ExpectedCount + 1));
}
示例7: TestInsertAndRemoveLowerValueRestoredMin
public void TestInsertAndRemoveLowerValueRestoredMin(TestData aData)
{
var heap = aData.GetHeap();
heap.Insert(aData.ExpectedMin - 1).Remove();
Assert.That(heap.Peek().Value, Is.EqualTo(aData.ExpectedMin));
}
示例8: TestCountIsCorrect
public void TestCountIsCorrect(TestData aData)
{
var heap = aData.GetHeap();
Assert.That(heap.Count, Is.EqualTo(aData.ExpectedCount));
}
示例9: TestAdjustingValueUp
public void TestAdjustingValueUp(TestData aData)
{
var heap = aData.GetHeap();
var node = heap.Insert(aData.ExpectedMin - 1);
node.Value = aData.ExpectedMin + 30;
Assert.That(heap.Peek().Value, Is.EqualTo(aData.ExpectedMin));
}