- IExtensionManager refactoring: LoadFeature is obsoleted and internal in favor of LoadFeatures.

- Related changes to callers.

--HG--
branch : dev
This commit is contained in:
Suha Can
2010-04-26 16:21:06 -07:00
parent 97f8ed294e
commit 4eb92e63ec
5 changed files with 11 additions and 21 deletions

View File

@@ -256,7 +256,7 @@ features:
[Test]
public void ExtensionManagerShouldThrowIfFeatureDoesNotExist() {
var featureDescriptor = new FeatureDescriptor { Name = "NoSuchFeature" };
Assert.Throws<ArgumentException>(() => _manager.LoadFeature(featureDescriptor));
Assert.Throws<ArgumentException>(() => _manager.LoadFeatures(new [] { featureDescriptor }));
}
[Test]
@@ -302,8 +302,10 @@ features:
.SelectMany(x => x.Features)
.Single(x => x.Name == "TestFeature");
foreach (var type in extensionManager.LoadFeature(testFeature).ExportedTypes) {
Assert.That(type == typeof(Phi));
foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) {
foreach (var type in feature.ExportedTypes) {
Assert.That(type == typeof(Phi));
}
}
}
@@ -328,9 +330,11 @@ features:
.SelectMany(x => x.Features)
.Single(x => x.Name == "TestModule");
foreach (var type in extensionManager.LoadFeature(testModule).ExportedTypes) {
Assert.That(type != typeof(Phi));
Assert.That((type == typeof(Alpha) || (type == typeof(Beta))));
foreach (var feature in extensionManager.LoadFeatures(new [] { testModule })) {
foreach (var type in feature.ExportedTypes) {
Assert.That(type != typeof(Phi));
Assert.That((type == typeof(Alpha) || (type == typeof(Beta))));
}
}
}