File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
AgileMapper.UnitTests.Orms Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public static string GetLocalDbConnectionString<TDbContext>()
1515 dbName = dbName . Substring ( 0 , dbName . Length - "Context" . Length ) ;
1616 }
1717
18- return "Data Source=(local);" +
18+ return "Data Source=(local)\\ SQLExpress ;" +
1919 "Initial Catalog=" + dbName + ";" +
2020 "Integrated Security=True;" +
2121 "MultipleActiveResultSets=True" ;
Original file line number Diff line number Diff line change 11namespace AgileObjects . AgileMapper . UnitTests
22{
33 using System . Collections . Generic ;
4+ using AgileMapper . Extensions ;
5+ using AgileMapper . Extensions . Internal ;
46 using TestClasses ;
57 using Xunit ;
68
@@ -334,6 +336,32 @@ public void ShouldHandleRuntimeTypedComplexAndEnumerableChildMembers()
334336 }
335337 }
336338
339+ [ Fact ]
340+ public void ShouldHandleRuntimeTypedComplexAndEnumerableElementMembers ( )
341+ {
342+ var source = new PublicTwoFields < object , IList < object > >
343+ {
344+ Value1 = new Product { ProductId = "kjdfskjnds" } ,
345+ Value2 = new List < object >
346+ {
347+ new PublicProperty < string > { Value = "ikjhfeslkjdw" } ,
348+ new PublicField < string > { Value = "ldkjkdhusdiuoji" }
349+ }
350+ } ;
351+
352+ var result = source . DeepClone ( ) ;
353+
354+ result . Value1 . ShouldBeOfType < Product > ( ) ;
355+ ( ( Product ) result . Value1 ) . ProductId . ShouldBe ( "kjdfskjnds" ) ;
356+
357+ result . Value2 . Count . ShouldBe ( 2 ) ;
358+ result . Value2 . First ( ) . ShouldBeOfType < PublicProperty < string > > ( ) ;
359+ ( ( PublicProperty < string > ) result . Value2 . First ( ) ) . Value . ShouldBe ( "ikjhfeslkjdw" ) ;
360+
361+ result . Value2 . Second ( ) . ShouldBeOfType < PublicField < string > > ( ) ;
362+ ( ( PublicField < string > ) result . Value2 . Second ( ) ) . Value . ShouldBe ( "ldkjkdhusdiuoji" ) ;
363+ }
364+
337365 #region Helper Classes
338366
339367 private class Country
You can’t perform that action at this time.
0 commit comments