public void FlattenCircularReferenceDtoOk() { //SETUP Mapper.Reset(); Mapper.Register <FlattenCircularReference, FlattenCircularReferenceDto>().Flatten(); Mapper.Compile(CompilationTypes.Source); //ATTEMPT var single = FlattenCircularReference.CreateOne(); var queryData = new List <FlattenCircularReference> { single }.AsQueryable(); var dto = queryData.Project <FlattenCircularReference, FlattenCircularReferenceDto>().Single(); //VERIFY Assert.AreEqual("Outer", dto.MyString); Assert.AreEqual("Son", dto.SonMyString); Assert.AreEqual("Inner", dto.CircularRefMyString); }
public void FlattenCircularReferenceDtoOk() { //SETUP Mapper.Register <FlattenCircularReference, FlattenCircularReferenceDto>() .Flatten(); Mapper.Compile(CompilationTypes.Source); //ATTEMPT var dto = Mapper.Map <FlattenCircularReference, FlattenCircularReferenceDto>(FlattenCircularReference.CreateOne()); //VERIFY Assert.AreEqual("Outer", dto.MyString); Assert.AreEqual("Son", dto.SonMyString); Assert.AreEqual("Inner", dto.CircularRefMyString); }