Skip to content

Commit d2a6a5a

Browse files
committed
Test coverage for nested types as generic type arguments
1 parent dcbd622 commit d2a6a5a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ReadableExpressions.UnitTests/WhenFormattingCode.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,16 @@ public void ShouldUseFriendlyNamesForMultiplyNestedTypes()
459459
Assert.AreEqual("typeof(OuterClass.InnerClass.Nested)", translated);
460460
}
461461

462+
[TestMethod]
463+
public void ShouldUseFriendlyNamesForListsOfNestedTypes()
464+
{
465+
var newNestedTypeList = Expression.New(typeof(List<>).MakeGenericType(typeof(OuterClass.InnerClass)));
466+
467+
var translated = newNestedTypeList.ToReadableString();
468+
469+
Assert.AreEqual("new List<OuterClass.InnerClass>()", translated);
470+
}
471+
462472
[TestMethod]
463473
public void ShouldUseFriendlyNamesForGenericNestedTypes()
464474
{

0 commit comments

Comments
 (0)