コード例 #1
0
        // 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);
            }
        }
コード例 #2
0
        public void ToString_ShouldReturnICompositionElementDisplayName()
        {
            var expectations = Expectations.GetAssemblies();

            foreach (var e in expectations)
            {
                var catalog = (ICompositionElement)CreateAssemblyCatalog(e);

                Assert.Equal(catalog.DisplayName, catalog.ToString());
            }
        }
コード例 #3
0
ファイル: AssemblyCatalogTests.cs プロジェクト: zqb971/mef
        // 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);
            }
        }
コード例 #4
0
        public void Constructor2_ValueAsAssemblyArgument_ShouldSetAssemblyProperty()
        {
            var expectations = Expectations.GetAssemblies();

            foreach (var e in expectations)
            {
                var catalog = new AssemblyCatalog(e);

                Assert.AreSame(e, catalog.Assembly);
            }
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
        // 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);
            }
        }