public void CanMapProperty() { Assert.DoesNotThrow(() => { Student writer = new Student(); propertyMapper.Map <Student>(StudentFactory.CreateDataRow(StudentFactory.CreateStudent()), writer); Assert.NotNull(writer.FirstName, "The FirstName property must not be null"); Assert.NotNull(writer.LastName, "The LastName property must not be null"); }, "The map operation must be successful"); }
public void CanMapDataRow() { DataRow dataRow = StudentFactory.CreateDataRow(testStudent); Assert.DoesNotThrow(() => { Student student = dataSetMapper.Map <Student>(dataRow); Assert.NotNull(student, "The mapping must return a non-null value"); Assert.NotNull(student.FirstName, "The FirstName must be not-null"); Assert.NotNull(student.LastName, "The LastName must be not-null"); Assert.AreEqual(testStudent.FirstName, student.FirstName, "The FirstName must be equal to the row's value"); Assert.AreEqual(testStudent.LastName, student.LastName, "The LastName must be equal to the row's value"); Assert.AreEqual(testStudent.Age, student.Age, "The Age must be equal to the row's value"); }, "The map operation on the DataRow must be successful"); }