public void Should_Correctly_Map_String_Column_To_Nested_Class_Property() { var sut = BuildAndConfigureFor <ContainsNestedClassesDto <string, PrimitiveDto <string> > >(); const string expectedValue = "ThisShouldGetMappedToTheNestedClassProperty"; using (var reader = ContainsNestedClassesDto <string, PrimitiveDto <string> > .BuildReader(expectedValue)) { reader.Read(); var actual = sut.Map <ContainsNestedClassesDto <string, PrimitiveDto <string> > >(reader); Assert.AreEqual(expectedValue, actual.NestedPropertyToTest.PropertyToTest); } }
public void Should_Correctly_Cache_Mapping_Function_For_Class_Property_After_Configure_On_Parent() { var sut = BuildAndConfigureFor <ContainsNestedClassesDto <string, PrimitiveDto <string> > >(); const string expectedValue = "THIS"; using (var reader = ContainsNestedClassesDto <string, PrimitiveDto <string> > .BuildReader(expectedValue)) { reader.Read(); var theParent = sut.Map <ContainsNestedClassesDto <string, PrimitiveDto <string> > >(reader); var actual = sut.Map <PrimitiveDto <string> >(reader); Assert.AreEqual(expectedValue, actual.PropertyToTest); Assert.AreEqual(expectedValue, theParent.NestedPropertyToTest.PropertyToTest); } }