Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #405. Unicode please!!! #406

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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