ChangeableListTests TestCloningChangeableList 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 TestCloningChangeableList()
Examples

[Test]
public void TestCloningChangeableList()
{
    foreach (int num1 in list)
    {
        Assert.AreEqual(1, num1);
        list.Add(1);
        var testList2 = new ChangeableList<int>(list);
        foreach (int num2 in testList2)
        {
            Assert.AreEqual(1, num2);
            testList2.Add(2);
            // The lists should be different here (testList2 is cloned)
            Assert.False(list == testList2);
            // But the data in it should be still equal.
            Assert.AreEqual(list.ToText(), testList2.ToText());
            break;
        }
        break;
    }
}
See Also