// Test Codebase variant of the APIs public static void Constructor_ValueAsCodebaseArgument_ShouldSetAssemblyProperty(Func <string, AssemblyCatalog> catalogCreator) { var expectations = Expectations.GetAssemblies(); foreach (var e in expectations) { var catalog = catalogCreator(e.CodeBase); Assert.Same(e, catalog.Assembly); } }
public void ToString_ShouldReturnICompositionElementDisplayName() { var expectations = Expectations.GetAssemblies(); foreach (var e in expectations) { var catalog = (ICompositionElement)CreateAssemblyCatalog(e); Assert.Equal(catalog.DisplayName, catalog.ToString()); } }
// Test Assembly variant of the APIs public static void Constructor_ValueAsAssemblyArgument_ShouldSetAssemblyProperty(Func <Assembly, AssemblyCatalog> catalogCreator) { var expectations = Expectations.GetAssemblies(); foreach (var e in expectations) { var catalog = catalogCreator(e); Assert.AreSame(e, catalog.Assembly); } }
public void Constructor2_ValueAsAssemblyArgument_ShouldSetAssemblyProperty() { var expectations = Expectations.GetAssemblies(); foreach (var e in expectations) { var catalog = new AssemblyCatalog(e); Assert.AreSame(e, catalog.Assembly); } }
public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAndAssemblyFullName() { var expectations = Expectations.GetAssemblies(); foreach (var e in expectations) { var catalog = (ICompositionElement) new DerivedAssemblyCatalog(e); string expected = string.Format("DerivedAssemblyCatalog (Assembly=\"{0}\")", e.FullName); Assert.Equal(expected, catalog.DisplayName); } }
// Test Codebase variant of the APIs internal static void Constructor_ValueAsCodebaseArgument_ShouldSetAssemblyProperty(Func <string, AssemblyCatalog> catalogCreator) { var expectations = Expectations.GetAssemblies(); foreach (var e in expectations) { #pragma warning disable SYSLIB0012 var catalog = catalogCreator(e.CodeBase); #pragma warning restore SYSLIB0012 Assert.Same(e, catalog.Assembly); } }