Exemple #1
0
        public void Test2()
        {
            Assembly assembly = Assembly.LoadFrom("SomeAssembly");

            var typeInfoExtractionService = new TypeInfoExtractionService();
            var moduleType = typeInfoExtractionService.GetTypes(assembly).FirstOrDefault();

            var isType = typeInfoExtractionService.IsCompositionModule(moduleType, typeof(ICompositionModule <IServiceCollection>));

            isType.Should().BeTrue();
        }
Exemple #2
0
        public void Test1()
        {
            PluginLoader loader = PluginLoader.CreateFromAssemblyFile(
                Path.Combine(Directory.GetCurrentDirectory(), "SomeAssembly.Impl.dll"),
                r => r.PreferSharedTypes = true);

            Assembly assembly = loader.LoadDefaultAssembly();

            var typeInfoExtractionService = new TypeInfoExtractionService();
            var moduleType = typeInfoExtractionService.GetTypes(assembly).FirstOrDefault(t => t.Name == "Module");

            var isType =
                typeInfoExtractionService.IsCompositionModule(moduleType,
                                                              typeof(ICompositionModule <IServiceCollection>));

            isType.Should().BeTrue();
        }