Ejemplo n.º 1
0
        public void TestMappingForCustomDateEntityIsInputIsEmpty()
        {
            var mapper     = new EmployeeMapper();
            var mappedData = mapper.MapCustomDate(null);

            Assert.NotNull(mappedData);
        }
Ejemplo n.º 2
0
        public void TestMappingForCustomDateEntity()
        {
            var mapper     = new EmployeeMapper();
            var mappedData = mapper.MapCustomDate(_employees);

            Assert.NotNull(mappedData);
            Assert.AreEqual(4, mappedData.Count);
            Assert.AreEqual("PersonNumber", mappedData[0].Person.PersonNumber);
            Assert.AreEqual(new DateTime(2017, 1, 15), mappedData[0].Date);
            Assert.AreEqual("CustomDateTypeName1", mappedData[0].CustomDateTypeName);
            Assert.AreEqual("FirstName", mappedData[0].Person.FirstName);
            Assert.AreEqual("LastName", mappedData[0].Person.LastName);

            Assert.AreEqual("PersonNumber", mappedData[1].Person.PersonNumber);
            Assert.AreEqual(new DateTime(2017, 1, 16), mappedData[1].Date);
            Assert.AreEqual("CustomDateTypeName1_2", mappedData[1].CustomDateTypeName);
            Assert.AreEqual("FirstName", mappedData[1].Person.FirstName);
            Assert.AreEqual("LastName", mappedData[1].Person.LastName);

            Assert.AreEqual("PersonNumber2", mappedData[2].Person.PersonNumber);
            Assert.AreEqual(new DateTime(2017, 1, 17), mappedData[2].Date);
            Assert.AreEqual("CustomDateTypeName2", mappedData[2].CustomDateTypeName);
            Assert.AreEqual("FirstName2", mappedData[2].Person.FirstName);
            Assert.AreEqual("LastName2", mappedData[2].Person.LastName);

            Assert.AreEqual("PersonNumber2", mappedData[3].Person.PersonNumber);
            Assert.AreEqual(new DateTime(2017, 1, 18), mappedData[3].Date);
            Assert.AreEqual("CustomDateTypeName2_2", mappedData[3].CustomDateTypeName);
            Assert.AreEqual("FirstName2", mappedData[3].Person.FirstName);
            Assert.AreEqual("LastName2", mappedData[3].Person.LastName);
        }