Пример #1
0
        public void CanMapDataTable()
        {
            DataTable dataTable = StudentFactory.CreateDataTable(StudentFactory.CreateStudentList());

            Assert.DoesNotThrow(() =>
            {
                IEnumerable <Student> writers = dataSetMapper.Map <Student>(dataTable);

                Assert.NotNull(writers, "The mapping must return a non-null value");
                Assert.Greater(arg1: writers.Count(), arg2: 0, "The mapping must return a non-empty Enumerable");

                foreach (Student writer in writers)
                {
                    Assert.NotNull(writer, "The value in the Enumerable must not be null");

                    Assert.NotNull(writer.FirstName, "The FirstName must be not-null");
                    Assert.NotNull(writer.LastName, "The LastName must be not-null");
                }
            },
                                "The map operation on the DataTable must be successful");
        }