当前位置: 首页>>代码示例>>C#>>正文


C# Suite.GetModule方法代码示例

本文整理汇总了C#中Suite.GetModule方法的典型用法代码示例。如果您正苦于以下问题:C# Suite.GetModule方法的具体用法?C# Suite.GetModule怎么用?C# Suite.GetModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Suite的用法示例。


在下文中一共展示了Suite.GetModule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

        public void SetUp()
        {
            kernel = new StandardKernel();
            Kernel.RegisterCoreBindings(kernel);
            kernel.Bind<IFileSystemDirectory>().ToConstant(new TestFileSystemDirectory("root")).WhenTargetHas
                <SuiteRootAttribute>();

            output = new TestUserOutput();
            kernel.Bind<IUserOutput>().ToConstant(output).InSingletonScope();

            suite = kernel.Get<Suite>();
            suite.Name = "test suite";
            var mod1 = suite.GetModule("first module");
            var mod2 = suite.GetModule("other module");
            var mod3 = suite.GetModule("last module");

            var proj11 = mod1.GetProject("project 1.1");
            var proj12 = mod1.GetProject("project 1.2");
            var proj31 = mod3.GetProject("project 3.1");

            mod1.GetTestProject("test1");
            mod2.GetTestProject("test2");

            var cs = proj31.GetSourceSet("cs");
            var vb = proj31.GetSourceSet("vb");
            var fs = proj31.GetSourceSet("fs");

            cs.Add(new SuiteRelativePath("a.cs"));
            cs.Add(new SuiteRelativePath("b.cs"));
            cs.Add(new SuiteRelativePath("c.cs"));
            
            vb.Add(new SuiteRelativePath("x.vb"));
        }
开发者ID:zvrana,项目名称:bari,代码行数:33,代码来源:InfoTest.cs

示例2: GetModuleReturnsTheSameInstanceIfCalledTwice

        public void GetModuleReturnsTheSameInstanceIfCalledTwice()
        {
            var suite = new Suite(new TestFileSystemDirectory("root"));
            var mod1 = suite.GetModule("mod");
            var mod2 = suite.GetModule("mod");

            mod1.Should().BeSameAs(mod2);
        } 
开发者ID:zvrana,项目名称:bari,代码行数:8,代码来源:SuiteTest.cs

示例3: SetUp

        public void SetUp()
        {
            suite = new Suite(new TestFileSystemDirectory("root"));
            suiteNoExe = new Suite(new TestFileSystemDirectory("root"));
            suite.GetModule("TestModule").GetProject("TestLib").Type = ProjectType.Library;
            suiteNoExe.GetModule("TestModule").GetProject("TestLib").Type = ProjectType.Library;
            suite.GetModule("TestModule").GetProject("TestExe").Type = ProjectType.Executable;

            product = suite.GetProduct("TestProduct");
            product.AddModule(suite.GetModule("TestModule"));

            targetParser = new Mock<ICommandTargetParser>();
            buildTargetSource = new Mock<IHasBuildTarget>();
            data = new AddonSupportSolutionItemData(targetParser.Object, buildTargetSource.Object, new Goal("test"));
        }
开发者ID:vigoo,项目名称:bari,代码行数:15,代码来源:AddonSupportSolutionItemDataTest.cs

示例4: ExistingModulesMergedWithDiscoveredOnes

        public void ExistingModulesMergedWithDiscoveredOnes()
        {
            var fs = new TestFileSystemDirectory("root",
                                                 new TestFileSystemDirectory("src",
                                                                             new TestFileSystemDirectory("Module1",
                                                                                                         new TestFileSystemDirectory
                                                                                                             ("Project11"))));

            var suite = new Suite(fs);

            var module1 = suite.GetModule("Module1");
            var projectA = module1.GetProject("ProjectA");

            module1.Projects.Should().HaveCount(1);
            module1.Projects.Should().HaveElementAt(0, projectA);

            var discovery = new ModuleProjectDiscovery(fs);
            discovery.ExtendWithDiscoveries(suite);

            suite.Modules.Should().HaveCount(1);
            suite.Modules.Should().HaveElementAt(0, module1);
            module1.Projects.Should().HaveCount(2);
            module1.Projects.Should().Contain(projectA);
            module1.Projects.Should().Contain(p => p.Name == "Project11");
        }
开发者ID:vigoo,项目名称:bari,代码行数:25,代码来源:ModuleProjectDiscoveryTest.cs

示例5: ExtendWithDiscoveries

        /// <summary>
        /// Extends suite model with discovered information based on bari conventions
        /// </summary>        
        /// <param name="suite">The suite model to be extended with discoveries</param>
        public void ExtendWithDiscoveries(Suite suite)
        {
            var srcDir = suiteRoot.GetChildDirectory("src");
            srcDir.With(s => s.ChildDirectories.Do(
                moduleName =>
                {
                    Module module = suite.GetModule(moduleName);

                    var moduleDir = srcDir.GetChildDirectory(moduleName);
                    foreach (var projectName in moduleDir.ChildDirectories)
                    {
                        if (projectName.Equals("tests", StringComparison.InvariantCultureIgnoreCase))
                        {
                            // This is the special subdirectory for test projects
                            var testsDir = moduleDir.GetChildDirectory(projectName);
                            foreach (var testProjectName in testsDir.ChildDirectories)
                            {
                                var testProject = module.GetTestProject(testProjectName);
                                DiscoverProjectSources(testProject, testsDir.GetChildDirectory(testProjectName));
                            }
                        }
                        else
                        {
                            // This is a project directory

                            Project project = module.GetProject(projectName);
                            DiscoverProjectSources(project, moduleDir.GetChildDirectory(projectName));
                        }
                    }
                }));
        }
开发者ID:zvrana,项目名称:bari,代码行数:35,代码来源:ModuleProjectDiscovery.cs

示例6: HasModuleWorksCorrectly

        public void HasModuleWorksCorrectly()
        {
            var suite = new Suite(new TestFileSystemDirectory("root"));

            suite.HasModule("mod").Should().BeFalse();
            suite.GetModule("mod");
            suite.HasModule("mod").Should().BeTrue();
        }
开发者ID:zvrana,项目名称:bari,代码行数:8,代码来源:SuiteTest.cs

示例7: GetModuleCreatesInstanceIfMissing

        public void GetModuleCreatesInstanceIfMissing()
        {
            var suite = new Suite(new TestFileSystemDirectory("root"));
            var mod1 = suite.GetModule("mod");

            mod1.Should().NotBeNull();
            mod1.Name.Should().Be("mod");
        }
开发者ID:zvrana,项目名称:bari,代码行数:8,代码来源:SuiteTest.cs

示例8: ProjectsDiscovered

        public void ProjectsDiscovered()
        {
            var fs = new TestFileSystemDirectory("root",
                                     new TestFileSystemDirectory("src",
                                                                 new TestFileSystemDirectory("Module1",
                                                                     new TestFileSystemDirectory("Project11")),
                                                                 new TestFileSystemDirectory("Module2"),
                                                                 new TestFileSystemDirectory("Module3",
                                                                     new TestFileSystemDirectory("Project31"),
                                                                     new TestFileSystemDirectory("Project32"))),
                                     new TestFileSystemDirectory("output"));

            var suite = new Suite(fs);

            suite.Modules.Should().BeEmpty();

            var discovery = new ModuleProjectDiscovery(fs);
            discovery.ExtendWithDiscoveries(suite);

            suite.Modules.Should().HaveCount(3);
            suite.Modules.Should().OnlyContain(m => m.Name == "Module1" ||
                                                    m.Name == "Module2" ||
                                                    m.Name == "Module3");

            suite.GetModule("Module1").Projects.Should().HaveCount(1);
            suite.GetModule("Module1").Projects.Should().Contain(p => p.Name == "Project11");
            suite.GetModule("Module2").Projects.Should().HaveCount(0);
            suite.GetModule("Module3").Projects.Should().HaveCount(2);
            suite.GetModule("Module3").Projects.Should().Contain(p => p.Name == "Project31");
            suite.GetModule("Module3").Projects.Should().Contain(p => p.Name == "Project32");
        }
开发者ID:zvrana,项目名称:bari,代码行数:31,代码来源:ModuleProjectDiscoveryTest.cs

示例9: SetUp

        public void SetUp()
        {
            fallback = new Mock<ISlnNameGenerator>();                        
            suite = new Suite(new TestFileSystemDirectory("root"));
            suiteContents = new DefaultSuiteContentsAnalyzer(suite);
            generator = new ReadableSlnNameGenerator(fallback.Object, suiteContents);

            fallback.Setup(f => f.GetName(It.IsAny<IEnumerable<Project>>())).Returns("fallback");

            // mod1: proj11, testproj11
            // mod2: proj21, proj22
            // mod3: proj31        
            // mod4: proj41
            // mod5: proj51
            // mod6: proj61
            // mod7: proj71

            // prod1: mod1, mod2
            // prod2: mod2, mod3

            mod1 = suite.GetModule("mod1");
            mod2 = suite.GetModule("mod2");
            mod3 = suite.GetModule("mod3");
            mod4 = suite.GetModule("mod4");
            mod5 = suite.GetModule("mod5");
            mod6 = suite.GetModule("mod6");
            mod7 = suite.GetModule("mod7");
            mod8 = suite.GetModule("mod8");

            proj11 = mod1.GetProject("proj1");
            tproj11 = mod1.GetTestProject("test1");
            proj21 = mod2.GetProject("proj21");
            proj22 = mod2.GetProject("proj22");
            proj31 = mod3.GetProject("proj3");
            proj41 = mod4.GetProject("proj4");
            proj51 = mod5.GetProject("proj5");
            proj61 = mod6.GetProject("proj6");
            proj71 = mod7.GetProject("proj7");
            proj81 = mod8.GetProject("proj8");
            tproj81 = mod8.GetTestProject("test8");

            prod1 = suite.GetProduct("prod1");
            prod1.AddModule(mod1);
            prod1.AddModule(mod2);

            prod2 = suite.GetProduct("prod2");
            prod2.AddModule(mod2);
            prod2.AddModule(mod3);
        }
开发者ID:zvrana,项目名称:bari,代码行数:49,代码来源:ReadableSlnNameGeneratorTest.cs

示例10: Issue90_SingleProjectProduct

        public void Issue90_SingleProjectProduct()
        {
            var s = new Suite(new TestFileSystemDirectory("z"));
            var m = s.GetModule("m");
            var p = m.GetProject("p");
            var prod = s.GetProduct("prod");
            prod.AddModule(m);

            var sc = new DefaultSuiteContentsAnalyzer(s);
            var g = new ReadableSlnNameGenerator(fallback.Object, sc);
            var name = g.GetName(new[] { p });
            name.Should().Be("prod");
        }
开发者ID:vigoo,项目名称:bari,代码行数:13,代码来源:ReadableSlnNameGeneratorTest.cs

示例11: ExistingSourcesMergedWithDiscoveredOnes

        public void ExistingSourcesMergedWithDiscoveredOnes()
        {
            var fs = CreateFsWithSources();

            var suite = new Suite(fs);

            var fsSet = suite.GetModule("Module1").GetProject("Project11").GetSourceSet("fs");
            var vbSet = suite.GetModule("Module1").GetProject("Project11").GetSourceSet("vb");

            fsSet.Add(new SuiteRelativePath(Path.Combine("src", "Module1", "Project11", "fs", "b.fs")));
            vbSet.Add(new SuiteRelativePath(Path.Combine("src", "Module1", "Project11", "vb", "x.vb")));

            var discovery = new ModuleProjectDiscovery(fs);
            discovery.ExtendWithDiscoveries(suite);

            var project = suite.GetModule("Module1").GetProject("Project11");
            project.SourceSets.Should().HaveCount(3);
            project.SourceSets.Should().Contain(set => set.Type == "cs");
            project.SourceSets.Should().Contain(set => set.Type == "fs");
            project.SourceSets.Should().Contain(set => set.Type == "vb");

            var csSet = project.GetSourceSet("cs");
            fsSet = project.GetSourceSet("fs");
            vbSet = project.GetSourceSet("vb");

            csSet.Files.Should().HaveCount(3);
            csSet.Files.Should().Contain(new SuiteRelativePath(Path.Combine("src", "Module1", "Project11", "cs", "source1.cs")));
            csSet.Files.Should().Contain(new SuiteRelativePath(Path.Combine("src", "Module1", "Project11", "cs", "source2.cs")));
            csSet.Files.Should().Contain(new SuiteRelativePath(Path.Combine("src", "Module1", "Project11", "cs", "subdir", "source3.cs")));

            fsSet.Files.Should().HaveCount(2);
            fsSet.Files.Should().Contain(new SuiteRelativePath(Path.Combine("src", "Module1", "Project11", "fs", "a.fs")));
            fsSet.Files.Should().Contain(new SuiteRelativePath(Path.Combine("src", "Module1", "Project11", "fs", "b.fs")));

            vbSet.Files.Should().HaveCount(1);
            vbSet.Files.Should().HaveElementAt(0, new SuiteRelativePath(Path.Combine("src", "Module1", "Project11", "vb", "x.vb")));
        }
开发者ID:vigoo,项目名称:bari,代码行数:37,代码来源:ModuleProjectDiscoveryTest.cs

示例12: SetUp

        public void SetUp()
        {
            kernel = new StandardKernel();
            Kernel.RegisterCoreBindings(kernel);
            kernel.Bind<IFileSystemDirectory>().ToConstant(new TestFileSystemDirectory("root")).WhenTargetHas
                <SuiteRootAttribute>();
            kernel.Bind<IFileSystemDirectory>().ToConstant(new TestFileSystemDirectory("target")).WhenTargetHas
                <TargetRootAttribute>();
            kernel.Bind<IProjectGuidManagement>().To<DefaultProjectGuidManagement>();

            suite = kernel.Get<Suite>();
            suite.Name = "test suite";

            var mod = suite.GetModule("testmod");
            project = mod.GetProject("test");

            kernel.Bind<Suite>().ToConstant(suite);
            kernel.Bind<Project>().ToConstant(project);
        }
开发者ID:vigoo,项目名称:bari,代码行数:19,代码来源:CsprojBuilderTest.cs

示例13: TestProjectsDiscovered

        public void TestProjectsDiscovered()
        {
            var fs = CreateFsWithSourcesAndTests();

            var suite = new Suite(fs);
            suite.Modules.Should().BeEmpty();

            var discovery = new ModuleProjectDiscovery(fs);
            discovery.ExtendWithDiscoveries(suite);

            suite.Modules.Should().HaveCount(3);
            suite.Modules.Should().OnlyContain(m => m.Name == "Module1" ||
                                                    m.Name == "Module2" ||
                                                    m.Name == "Module3");

            var mod3 = suite.GetModule("Module3");
            mod3.Projects.Should().HaveCount(2);
            mod3.Projects.Should().Contain(p => p.Name == "Project31");
            mod3.Projects.Should().Contain(p => p.Name == "Project32");
            mod3.TestProjects.Should().HaveCount(2);
            mod3.TestProjects.Should().Contain(p => p.Name == "Project31.Test");
            mod3.TestProjects.Should().Contain(p => p.Name == "Project32.Test");
        }
开发者ID:vigoo,项目名称:bari,代码行数:23,代码来源:ModuleProjectDiscoveryTest.cs

示例14: SourceSetsDiscovered

        public void SourceSetsDiscovered()
        {
            var fs = CreateFsWithSources();

            var suite = new Suite(fs);

            suite.Modules.Should().BeEmpty();

            var discovery = new ModuleProjectDiscovery(fs);
            discovery.ExtendWithDiscoveries(suite);

            var project = suite.GetModule("Module1").GetProject("Project11");
            project.SourceSets.Should().HaveCount(2);
            project.SourceSets.Should().Contain(set => set.Type == "cs");
            project.SourceSets.Should().Contain(set => set.Type == "fs");

            var csSet = project.GetSourceSet("cs");
            var fsSet = project.GetSourceSet("fs");

            csSet.Files.Should().HaveCount(3);
            csSet.Files.Should().Contain(new SuiteRelativePath("src\\Module1\\Project11\\cs\\source1.cs"));
            csSet.Files.Should().Contain(new SuiteRelativePath("src\\Module1\\Project11\\cs\\source2.cs"));
            csSet.Files.Should().Contain(new SuiteRelativePath("src\\Module1\\Project11\\cs\\subdir\\source3.cs"));

            fsSet.Files.Should().HaveCount(1);
            fsSet.Files.Should().HaveElementAt(0, new SuiteRelativePath("src\\Module1\\Project11\\fs\\a.fs"));
        }
开发者ID:zvrana,项目名称:bari,代码行数:27,代码来源:ModuleProjectDiscoveryTest.cs

示例15: LoadProduct

        private void LoadProduct(Suite suite, Product product, YamlNode productNode)
        {
            Contract.Requires(product != null);
            Contract.Requires(productNode != null);

            foreach (KeyValuePair<string, YamlNode> item in parser.EnumerateNamedNodesOf(productNode, "modules"))
            {
                if (suite.HasModule(item.Key))
                {
                    var module = suite.GetModule(item.Key);
                    product.AddModule(module);
                }
                else
                {
                    output.Warning(String.Format("The product {0} refers to a non-existing module {1}", product.Name, item.Key));
                }
            }

            SetProjectPostProcessors(suite, product, productNode);
            LoadParameters(suite, product, productNode);
        }
开发者ID:zvrana,项目名称:bari,代码行数:21,代码来源:YamlModelLoaderBase.cs


注:本文中的Suite.GetModule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。