fixed SPRNET-985 (UnsatisfiedNonSimpleProperties didn't take existing property values in ObjectDefinition into account)
added CollectionUtils.ToArray()
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -355,5 +355,21 @@ namespace Spring.Util
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ToArray()
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
list.Add("mystring");
|
||||
string[] strList = (string[]) CollectionUtils.ToArray(list, typeof(string));
|
||||
Assert.AreEqual(1, strList.Length);
|
||||
|
||||
try
|
||||
{
|
||||
CollectionUtils.ToArray(list, typeof(Type));
|
||||
Assert.Fail("should fail");
|
||||
}
|
||||
catch(InvalidCastException) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user