public void getColumnNamesFromPocoTypeTest() { var columns = ReportParserUtils.GetColumnNamesFromPocoType <TestRow>() .ToDictionary(name => name); Assert.AreEqual(3, columns.Count); Assert.IsTrue(columns.ContainsKey("Atrib1")); Assert.IsTrue(columns.ContainsKey("Atrib2")); Assert.IsTrue(columns.ContainsKey("Atrib3")); }
public void getColAndPropNamesTest() { var names = ReportParserUtils.GetColAndPropNames <TestRow>(); Assert.AreEqual(3, names.Count()); var propNames = names.ToDictionary(x => x.Item2); Assert.IsTrue(propNames.ContainsKey("Atrib1")); Assert.IsTrue(propNames.ContainsKey("Atrib2")); Assert.IsTrue(propNames.ContainsKey("AtribX")); }
public void setColumnValueTest() { var testRow = new TestRow(); Action <ColumnValuePair, TestRow> doNothing = (a, b) => {}; ReportParserUtils.SetColumnValue(new ColumnValuePair("Atrib1", "1"), testRow, doNothing); ReportParserUtils.SetColumnValue(new ColumnValuePair("Atrib2", "2"), testRow, doNothing); ReportParserUtils.SetColumnValue(new ColumnValuePair("Atrib3", "3"), testRow, doNothing); Assert.IsTrue(Math.Abs(1.0 - testRow.Atrib1) < 0.0000001); Assert.AreEqual("2", testRow.Atrib2); Assert.AreEqual(3, testRow.AtribX); }
public void getPropNameFromColNameTest() { Assert.AreEqual("Atrib1", ReportParserUtils.GetPropNameFromColName <TestRow>("Atrib1")); Assert.AreEqual("Atrib2", ReportParserUtils.GetPropNameFromColName <TestRow>("Atrib2")); Assert.AreEqual("AtribX", ReportParserUtils.GetPropNameFromColName <TestRow>("Atrib3")); }
public void testValidatePocoType() { Assert.Throws <ArgumentException>(() => ReportParserUtils.ValidatePocoType <InvalidTestRow>() ); }
public void testValidatePocoType() { ReportParserUtils.ValidatePocoType <InvalidTestRow>(); }