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


C# VsPackageSourceProvider.GetPackageSources方法代码示例

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


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

示例1: CtorAddsAggregrateIfAggregateWasPersistedIntoSettingsManager

        public void CtorAddsAggregrateIfAggregateWasPersistedIntoSettingsManager()
        {
            // Arrange
            var userSettingsManager = new MockUserSettingsManager();
            var registrySettingsManager = new MockPackageSourceSettingsManager();
            registrySettingsManager.PackageSourcesString = "<ArrayOfPackageSource xmlns=\"http://schemas.datacontract.org/2004/07/NuGet\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><PackageSource><IsAggregate>false</IsAggregate><Name>a</Name><Source>a</Source></PackageSource></ArrayOfPackageSource>";
            var provider = new VsPackageSourceProvider(registrySettingsManager, userSettingsManager);

            // Act
            var sources = provider.GetPackageSources().ToList();

            // Assert
            Assert.AreEqual(2, sources.Count);
            Assert.AreEqual(provider.AggregateSource, sources[0]);
            Assert.AreEqual(new PackageSource("a", "a"), sources[1]);
        }
开发者ID:grendello,项目名称:nuget,代码行数:16,代码来源:VsPackageSourceProviderTest.cs

示例2: AggregateSourceWithoutIsAggregateFlagSetFlagToTrue

        public void AggregateSourceWithoutIsAggregateFlagSetFlagToTrue()
        {
            // Arrange
            var userSettingsManager = new MockUserSettingsManager();
            var registrySettingsManager = new MockPackageSourceSettingsManager();
            registrySettingsManager.PackageSourcesString = "<ArrayOfPackageSource xmlns=\"http://schemas.datacontract.org/2004/07/NuGet\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><PackageSource><Name>All</Name><Source>(Aggregate source)</Source></PackageSource><PackageSource><IsAggregate>false</IsAggregate><Name>NuGet official package source</Name><Source>https://go.microsoft.com/fwlink/?LinkID=206669</Source></PackageSource></ArrayOfPackageSource>";
            var provider = new VsPackageSourceProvider(registrySettingsManager, userSettingsManager);

            // Act
            var sources = provider.GetPackageSources().ToList();

            // Assert
            Assert.AreEqual(2, sources.Count);
            Assert.IsTrue(sources[0].IsAggregate);
        }
开发者ID:grendello,项目名称:nuget,代码行数:15,代码来源:VsPackageSourceProviderTest.cs

示例3: CtorAddsDefaultSourceIfAnotherDefaultWasPreviouslyRegistered

        public void CtorAddsDefaultSourceIfAnotherDefaultWasPreviouslyRegistered()
        {
            // Arrange
            var registrySettingsManager = new MockPackageSourceSettingsManager();
            var userSettingsManager = new MockUserSettingsManager();
            registrySettingsManager.PackageSourcesString = "<ArrayOfPackageSource xmlns=\"http://schemas.datacontract.org/2004/07/NuGet\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><PackageSource><Name>NuGet official package source</Name><Source>http://some/old/feed</Source></PackageSource></ArrayOfPackageSource>";
            registrySettingsManager.ActivePackageSourceString = "<PackageSource xmlns=\"http://schemas.datacontract.org/2004/07/NuGet\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><IsAggregate>true</IsAggregate><Name>All</Name><Source>(Aggregate source)</Source></PackageSource>";
            var provider = new VsPackageSourceProvider(registrySettingsManager, userSettingsManager);

            // Act
            var sources = provider.GetPackageSources().ToList();

            // Assert
            Assert.AreEqual(2, sources.Count);
            Assert.AreEqual(VsPackageSourceProvider.DefaultPackageSource, sources[1].Source);
        }
开发者ID:grendello,项目名称:nuget,代码行数:16,代码来源:VsPackageSourceProviderTest.cs

示例4: CtorIfFirstRunningAddsDefaultSource

        public void CtorIfFirstRunningAddsDefaultSource()
        {
            // Arrange
            var registrySettingsManager = new MockPackageSourceSettingsManager();
            var userSettingsManager = new MockUserSettingsManager();
            var provider = new VsPackageSourceProvider(registrySettingsManager, userSettingsManager);

            // Act
            var sources = provider.GetPackageSources().ToList();

            // Assert
            Assert.AreEqual(2, sources.Count);
            Assert.AreEqual(VsPackageSourceProvider.DefaultPackageSource, sources[1].Source);
        }
开发者ID:grendello,项目名称:nuget,代码行数:14,代码来源:VsPackageSourceProviderTest.cs

示例5: CtorAddsAggregrateIfNothingWasPersistedIntoSettingsManager

        public void CtorAddsAggregrateIfNothingWasPersistedIntoSettingsManager()
        {
            // Arrange
            var registrySettingsManager = new MockPackageSourceSettingsManager();
            var userSettingsManager = new MockUserSettingsManager();
            var provider = new VsPackageSourceProvider(registrySettingsManager, userSettingsManager);

            // Act
            var sources = provider.GetPackageSources().ToList();

            // Assert
            Assert.AreEqual(2, sources.Count);
            Assert.AreEqual(provider.AggregateSource, sources[0]);
        }
开发者ID:grendello,项目名称:nuget,代码行数:14,代码来源:VsPackageSourceProviderTest.cs


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