public void ToList()
        {
            List <PreDataTable> Temp = new PreDataTable[] { new PreDataTable {
                                                                ID = 1, Value = "A"
                                                            }, new PreDataTable {
                                                                ID = 2, Value = "B"
                                                            }, new PreDataTable {
                                                                ID = 3, Value = "C"
                                                            } }.ToList();
            List <PreDataTable> Temp2 = Temp.To().To <PreDataTable>(() => new PreDataTable());

            Assert.Equal(Temp, Temp2);
        }
Esempio n. 2
0
        public void ToDataTable()
        {
            List <PreDataTable> Temp = new PreDataTable[] { new PreDataTable {
                                                                ID = 1, Value = "A"
                                                            }, new PreDataTable {
                                                                ID = 2, Value = "B"
                                                            }, new PreDataTable {
                                                                ID = 3, Value = "C"
                                                            } }.ToList();

            Temp.To();
            DataTable Temp2 = Temp.To();

            Assert.Equal(1, Temp2.Rows[0].ItemArray[0]);
            Assert.Equal("A", Temp2.Rows[0].ItemArray[1]);
            Assert.Equal(2, Temp2.Rows[1].ItemArray[0]);
            Assert.Equal("B", Temp2.Rows[1].ItemArray[1]);
            Assert.Equal(3, Temp2.Rows[2].ItemArray[0]);
            Assert.Equal("C", Temp2.Rows[2].ItemArray[1]);
        }
 public void ToDataTable()
 {
     List<PreDataTable> Temp = new PreDataTable[] { new PreDataTable { ID = 1, Value = "A" }, new PreDataTable { ID = 2, Value = "B" }, new PreDataTable { ID = 3, Value = "C" } }.ToList();
     Temp.To();
     DataTable Temp2 = Temp.To();
     Assert.Equal(1, Temp2.Rows[0].ItemArray[0]);
     Assert.Equal("A", Temp2.Rows[0].ItemArray[1]);
     Assert.Equal(2, Temp2.Rows[1].ItemArray[0]);
     Assert.Equal("B", Temp2.Rows[1].ItemArray[1]);
     Assert.Equal(3, Temp2.Rows[2].ItemArray[0]);
     Assert.Equal("C", Temp2.Rows[2].ItemArray[1]);
 }
 public void ToList()
 {
     List<PreDataTable> Temp = new PreDataTable[] { new PreDataTable { ID = 1, Value = "A" }, new PreDataTable { ID = 2, Value = "B" }, new PreDataTable { ID = 3, Value = "C" } }.ToList();
     List<PreDataTable> Temp2 = Temp.To().To<PreDataTable>(() => new PreDataTable());
     Assert.Equal(Temp, Temp2);
 }