ResolveSource() приватный Метод

private ResolveSource ( string packagePath ) : string
packagePath string
Результат string
Пример #1
0
 public void PushCommandUsesNuGetOrgWhenNoSourceSpecified(string input, string expected)
 {
     var push = new PushCommand();
     push.SourceProvider = CreateSourceProvider();
     push.Settings = CreateSettings();
     Assert.Equal(expected, push.ResolveSource(input));
 }
Пример #2
0
 public void PushCommandUsesConfFileWhenDefaultPushSourceSpecified()
 {
     const string src = "http://foo/bar/baz";
     var push = new PushCommand();
     push.SourceProvider = CreateSourceProvider();
     push.Settings = CreateSettings(src);
     Assert.Equal(src, push.ResolveSource(@"X:\test\foobar.symbols.nupkg"));
 }
Пример #3
0
 public void PushCommandUsesSourceWhenSpecifiedEvenWhenSpecifiedAlsoInConfFile()
 {
     const string srcCmdLine = "http://foo/bar/baz1";
     const string srcConfFile = "http://foo/bar/baz2";
     var push = new PushCommand();
     push.SourceProvider = CreateSourceProvider();
     push.Settings = CreateSettings(srcConfFile);
     push.Source = srcCmdLine;
     Assert.Equal(srcCmdLine, push.ResolveSource(@"X:\test\foobar.symbols.nupkg"));
 }
Пример #4
0
        public void PushCommandUsesSourceFromConfigurationDefaultsWhenDefaultPushSourceNotSpecifiedByUserOrInConfigFile()
        {
            // Arrange
            var push = new PushCommand();
            push.SourceProvider = CreateSourceProvider();
            push.Settings = CreateSettings();

            // Set Configuration Defaults
            var mockFileSystem = new MockFileSystem();
            var configurationDefaultsPath = "NuGetDefaults.config";
            mockFileSystem.AddFile(configurationDefaultsPath, @"
<configuration>
     <config>
        <add key='DefaultPushSource' value='http://contoso.com/packages/' />
    </config>
</configuration>");

            ConfigurationDefaults configurationDefaults = new ConfigurationDefaults(mockFileSystem, configurationDefaultsPath);

            // Act & Assert
            Assert.Equal(push.ResolveSource(@"X:\test\foobar.symbols.nupkg", configurationDefaults.DefaultPushSource), "http://contoso.com/packages/");
        }