public void should_iterate_through_collection() { var collection = new SortedSet<int> {10, 2, 3, 5}; var copyOfCollection = new List<int>(); using (SortedSet<int>.Enumerator enumerator = collection.GetEnumerator()) { while (enumerator.MoveNext()) { copyOfCollection.Add(enumerator.Current); } } // change the variable value to fix the test. var expectedCopyResult = new List<int> {10, 2, 3, 5}; Assert.Equal(expectedCopyResult, copyOfCollection); }