~alexreg/mathtexdotnet/0.1

« back to all changes in this revision

Viewing changes to TexDotNet.Tests/CollectionsExtensions.cs

  • Committer: Alex Regueiro
  • Date: 2009-09-25 19:25:01 UTC
  • Revision ID: alexreg@gmail.com-20090925192501-lyu4daug4m0f6he7
Rewrote testing framework. Tests work on principle that if you parse an expression, write it back, and parse it again, the two expression trees should always be equivalent.
Fixed bug in TexComposer involving  brackets.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
using System;
2
 
using System.Collections;
3
 
using System.Collections.Generic;
4
 
using System.Collections.Specialized;
5
 
using System.Collections.ObjectModel;
6
 
using System.Linq;
7
 
using System.Text;
8
 
 
9
 
namespace TexDotNet
10
 
{
11
 
    public static class CollectionsExtensions
12
 
    {
13
 
        public static T[] ToArray<T>(this IEnumerator<T> source)
14
 
        {
15
 
            var list = new List<T>();
16
 
            while (source.MoveNext())
17
 
                list.Add(source.Current);
18
 
            return list.ToArray();
19
 
        }
20
 
    }
21
 
}