SPRNET-1473 fixed returned type from GetServices(...) call

This commit is contained in:
Steve Bohlen
2011-10-07 18:04:11 -04:00
parent 62ec2c2610
commit 3f3dd9b836
2 changed files with 6 additions and 1 deletions

View File

@@ -89,7 +89,7 @@ namespace Spring.Web.Mvc
public IEnumerable<object> GetServices(Type serviceType)
{
var services = ApplicationContext.GetObjectsOfType(serviceType);
return services.Cast<object>();
return services.Values.Cast<object>();
}
}
}

View File

@@ -89,6 +89,11 @@ namespace Spring.Web.Mvc.Tests
{
var services = _resolver.GetServices(typeof(FirstContainerRegisteredController));
Assert.That(services.Count(), Is.EqualTo(2));
foreach (var service in services)
{
Assert.That(service, Is.TypeOf(typeof(FirstContainerRegisteredController)), "Service Returned was not of the expected Type.");
}
}
[Test]