本文整理汇总了C#中ArrayStack.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayStack.ToArray方法的具体用法?C# ArrayStack.ToArray怎么用?C# ArrayStack.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayStack
的用法示例。
在下文中一共展示了ArrayStack.ToArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertEmptyStackToArray
public void ConvertEmptyStackToArray()
{
ArrayStack<int> arrayStack = new ArrayStack<int>();
int [] expected= new int[0];
int[] actual = arrayStack.ToArray();
CollectionAssert.AreEqual(expected, actual);
}
示例2: TestEmptyStackToArray_ShouldReturnEmptyArray
public void TestEmptyStackToArray_ShouldReturnEmptyArray()
{
var stack = new ArrayStack<DateTime>();
var array = stack.ToArray();
var expected = new DateTime[0];
CollectionAssert.AreEqual(expected, array);
}
示例3: EmptyStackToArray
public void EmptyStackToArray()
{
var stack = new ArrayStack<DateTime>();
var testArr = new DateTime[0];
CollectionAssert.AreEqual(testArr, stack.ToArray());
}
示例4: TestEmptyStackToArray
public void TestEmptyStackToArray()
{
var stack = new ArrayStack<DateTime>();
DateTime[] array = stack.ToArray();
Assert.AreEqual(0, array.Length);
}
示例5: EmptyStackToArray_ShouldReturnEmptyArray
public void EmptyStackToArray_ShouldReturnEmptyArray()
{
var stack = new ArrayStack<DateTime>();
var actual = stack.ToArray().Length;
Assert.AreEqual(0, actual, "Array is not empty.");
}
示例6: ToArray_EmptyStack_ShouldReturnEmptyArray
public void ToArray_EmptyStack_ShouldReturnEmptyArray()
{
var stack = new ArrayStack<DateTime>();
var arr = stack.ToArray();
CollectionAssert.AreEqual(new DateTime [] {}, arr);
}
示例7: EmptyStackToArray_ArrayShouldBeEmpty
public void EmptyStackToArray_ArrayShouldBeEmpty()
{
var stack = new ArrayStack<int>();
var array = stack.ToArray();
Assert.AreEqual(0, array.Length);
}
示例8: TestEmptyStackToArray_ShouldReturnEmptyArray
public void TestEmptyStackToArray_ShouldReturnEmptyArray()
{
var stack = new ArrayStack<List<Dictionary<bool[], decimal>>>();
var arr = stack.ToArray();
Assert.AreEqual(0, arr.Length);
}
示例9: ToArray
public void ToArray(int[] data)
{
ArrayStack<int> testStack = new ArrayStack<int>();
for (int i = 0; i < data.Length; i++)
{
testStack.Push(data[i]);
}
int[] result = testStack.ToArray();
CollectionAssert.AreEqual(data.Reverse(),result);
}
示例10: array
public void array()
{
ArrayStack<int> testArray = new ArrayStack<int>();
testArray.Push(3);
testArray.Push(5);
testArray.Push(-2);
testArray.Push(7);
CollectionAssert.AreEqual(new int[] { 7, -2, 5, 3 }, testArray.ToArray());
}
示例11: ToArray_PushFewItems_ShouldReturnInReversedOrder
public void ToArray_PushFewItems_ShouldReturnInReversedOrder()
{
var stack = new ArrayStack<int>();
stack.Push(1);
stack.Push(2);
stack.Push(3);
var arr = stack.ToArray();
CollectionAssert.AreEqual(new [] {3, 2, 1}, arr);
}
示例12: ToArray
public void ToArray()
{
var stack = new ArrayStack<int>();
stack.Push(3);
stack.Push(5);
stack.Push(-2);
stack.Push(7);
int[] testArr = new[] {7, -2, 5, 3};
CollectionAssert.AreEqual(testArr, stack.ToArray());
}
示例13: ToArrayMethodShouldReturnArrayWithTheElementsOfArrayStack
public void ToArrayMethodShouldReturnArrayWithTheElementsOfArrayStack()
{
ArrayStack<int> arrayStack = new ArrayStack<int>();
arrayStack.Push(3);
arrayStack.Push(5);
arrayStack.Push(-2);
arrayStack.Push(7);
int[] array = arrayStack.ToArray();
Assert.AreEqual(7, array[0]);
}
示例14: EmptyStackToArrayShouldReturnEmptyArray
public void EmptyStackToArrayShouldReturnEmptyArray()
{
//Arrange
var stack = new ArrayStack<int>(1);
//Act
var array = stack.ToArray();
//Assert
CollectionAssert.AreEqual(new int[0] {}, array);
}
示例15: CheckEmptyStack_ToArrayMethod_ShouldReturnEmptyArray
public void CheckEmptyStack_ToArrayMethod_ShouldReturnEmptyArray()
{
// Arrange
ArrayStack<int> stack = new ArrayStack<int>();
// Act
int[] stackArr = stack.ToArray();
// Assert
Assert.AreEqual(0, stackArr.Length);
}