UniqueListTests ToArray Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.Extensions
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void ToArray()
Examples

[Test]
public void ToArray()
{
    var list = new UniqueList<int> { 3, 4 };
    int[] intList = list.ToArray();
    Assert.AreEqual(3, intList[0]);
    Assert.AreEqual(4, intList[1]);
    Assert.AreEqual(2, intList.Length);
}
[Test]
public void EmptyUniqueList()
{
    var list = new UniqueList<int> { 1, 2, 3 };
    IEnumerable weak = list.AsWeakEnumerable();
    var sequence = weak.Cast<int>().Take(3).ToArray();
    CollectionAssert.AreEqual(sequence,
        new[] { 1, 2, 3 });
See Also