public void AvrDataRowExCopyTest() { var originalTable = new AvrDataTable(); var rowDTO = new AvrDataRowDTO(1, 2, 2); rowDTO.SetInt(0, 1); rowDTO.SetInt(1, 2); rowDTO.SetObject(2, "xx"); rowDTO.SetObject(3, true); rowDTO.SetDateTime(4, new DateTime(2000, 1, 1)); AvrDataRowEx original = originalTable.NewRow(rowDTO); Assert.AreEqual(1, original[0]); Assert.AreEqual(2, original[1]); Assert.AreEqual("xx", original[2]); Assert.AreEqual(true, original[3]); Assert.AreEqual(new DateTime(2000, 1, 1), original[4]); AvrDataRowEx copy = (AvrDataRowEx)original.Clone(); Assert.IsNotNull(copy); Assert.AreNotSame(copy, original); Assert.AreEqual(original.Count, copy.Count); for (int i = 0; i < original.Count; i++) { Assert.AreEqual(original[i], copy[i]); } }
private static AvrPivotGridData GetTestData() { var table = new AvrDataTable(); for (int i = 0; i < 10; i++) { var rowDTO = new AvrDataRowDTO(1, 2, 2); rowDTO.SetInt(0, i); rowDTO.SetInt(1, 2 * i); rowDTO.SetObject(2, "xx_" + i); rowDTO.SetObject(3, true); rowDTO.SetDateTime(4, new DateTime(2000, 1, i + 1)); AvrDataRowEx row = table.NewRow(rowDTO); table.ThreadSafeAdd(row); } table.AcceptChanges(); return(new AvrPivotGridData(table)); }