示例#1
0
        public void Properties_and_table_names_are_matched_using_the_given_convention()
        {
            _row.Add("CHILD ID", 1);
            _row.Add("PARENT ID", _guid1);
            _row.Add("PARENT NAME", "parent name");

            _mapper = new EntityMapper(new ConventionReader(new UpperCaseConvention()));

            var instance = _mapper.CreateInstanceGraph <Child>(_row, _childParentRelation);

            Assert.IsNotNull(instance.Parent);
            Assert.AreEqual(1, instance.Id);
            Assert.AreEqual(_guid1, instance.Parent.Id);
            Assert.AreEqual("parent name", instance.Parent.Name);
        }
        public void Properties_and_table_names_are_matched_using_the_given_convention()
        {
            _row.Add("CHILD ID", 1);
            _row.Add("PARENT ID", _guid1);
            _row.Add("PARENT NAME", "parent name");

            _mapper = new EntityMapper(new ConventionReader(new UpperCaseConvention()));

            var instance = _mapper.CreateInstanceGraph<Child>(_row, _childParentRelation);

            Assert.IsNotNull(instance.Parent);
            Assert.AreEqual(1, instance.Id);
            Assert.AreEqual(_guid1, instance.Parent.Id);
            Assert.AreEqual("parent name", instance.Parent.Name);
        }