Skip to content

Commit

Permalink
Resolve #405. Unicode please!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
davidshen84 committed Jun 2, 2018
1 parent a9d6ad8 commit 62e2461
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/Castle.Windsor.Tests/TypeUtilTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,35 +58,35 @@ public void Closed_generic_simple_type()
public void Generic_nested_generic_typeArray_multi_dimentional_pulls_closed_generics_to_innermost_type()
{
var name = typeof(GenericHasNested<A2>.NestedGeneric<AProp>[,,]).ToCSharpString();
Assert.AreEqual("GenericHasNested<·TOuter·>.NestedGeneric<A2, AProp>[,,]", name);
Assert.AreEqual("GenericHasNested<·TOuter·>.NestedGeneric<A2, AProp>[,,]", name);
}

[Test]
public void Generic_nested_generic_typeArray_pulls_closed_generics_to_innermost_type()
{
var name = typeof(GenericHasNested<A2>.NestedGeneric<AProp>[]).ToCSharpString();
Assert.AreEqual("GenericHasNested<·TOuter·>.NestedGeneric<A2, AProp>[]", name);
Assert.AreEqual("GenericHasNested<·TOuter·>.NestedGeneric<A2, AProp>[]", name);
}

[Test]
public void Generic_nested_generic_type_pulls_closed_generics_to_innermost_type()
{
var name = typeof(GenericHasNested<A2>.NestedGeneric<AProp>).ToCSharpString();
Assert.AreEqual("GenericHasNested<·TOuter·>.NestedGeneric<A2, AProp>", name);
Assert.AreEqual("GenericHasNested<·TOuter·>.NestedGeneric<A2, AProp>", name);
}

[Test]
public void Generic_nested_type_array_ignores_outer_generic_argument()
{
var name = typeof(GenericHasNested<A2>.Nested[]).ToCSharpString();
Assert.AreEqual("GenericHasNested<·TOuter·>.Nested<A2>[]", name);
Assert.AreEqual("GenericHasNested<·TOuter·>.Nested<A2>[]", name);
}

[Test]
public void Generic_nested_type_ignores_outer_generic_argument()
{
var name = typeof(GenericHasNested<A2>.Nested).ToCSharpString();
Assert.AreEqual("GenericHasNested<·TOuter·>.Nested<A2>", name);
Assert.AreEqual("GenericHasNested<·TOuter·>.Nested<A2>", name);
}

[Test]
Expand Down Expand Up @@ -121,14 +121,14 @@ public void Non_generic_simple_type_array()
public void Open_generic_double_type()
{
var name = typeof(IDoubleGeneric<,>).ToCSharpString();
Assert.AreEqual("IDoubleGeneric<·TOne·, ·TTwo·>", name);
Assert.AreEqual("IDoubleGeneric<·TOne·, ·TTwo·>", name);
}

[Test]
public void Open_generic_simple_type()
{
var name = typeof(GenericImpl1<>).ToCSharpString();
Assert.AreEqual("GenericImpl1<·T·>", name);
Assert.AreEqual("GenericImpl1<·T·>", name);
}
}
}
}
2 changes: 1 addition & 1 deletion src/Castle.Windsor/Core/Internal/TypeUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private static void ToCSharpString(Type type, StringBuilder name)
if (type.IsGenericParameter)
{
//NOTE: this has to go before type.IsNested because nested generic type is also a generic parameter and otherwise we'd have stack overflow
name.AppendFormat("·{0}·", type.Name);
name.AppendFormat("·{0}·", type.Name);
return;
}
if (type.IsNested)
Expand Down

0 comments on commit 62e2461

Please sign in to comment.