Beispiel #1
0
        public void SortMissingColumn()
        {
            MutableDataTable d1 = DataTable.New.Read(new StringReader(
                                                         @"first, Last
Bob, Jones
Alfred, Smith
Ed, Edson
"));

            Assert.Throws <ArgumentException>(
                () => d1.Sort("missing"));

            Assert.Throws <ArgumentException>(
                () => d1.Sort(null));
        }
Beispiel #2
0
        public void Sort()
        {
            MutableDataTable d1 = DataTable.New.Read(new StringReader(
                                                         @"first, Last
Bob, Jones
Alfred, Smith
Ed, Edson
"));

            d1.Sort("first");
            AssertEquals(
                @"first,Last
Alfred,Smith
Bob,Jones
Ed,Edson
", d1);
            d1.Sort("last");
            AssertEquals(
                @"first,Last
Ed,Edson
Bob,Jones
Alfred,Smith
", d1);
        }