public void Clone_CopiesAllPropertyValuesFromSource() { // Arrange var credentials = new PackageSourceCredential("SourceName", "username", "password", isPasswordClearText: false, validAuthenticationTypesText: null); var source = new PackageSource("Source", "SourceName", isEnabled: false) { Credentials = credentials, ProtocolVersion = 43 }; // Act var result = source.Clone(); // Assert // source data Assert.Equal(source.Source, result.Source); Assert.Equal(source.Name, result.Name); Assert.Equal(source.IsEnabled, result.IsEnabled); Assert.Equal(source.ProtocolVersion, result.ProtocolVersion); // source credential result.Credentials.Should().NotBeNull(); result.Credentials.Source.ShouldBeEquivalentTo(source.Credentials.Source); result.Credentials.Username.ShouldBeEquivalentTo(source.Credentials.Username); result.Credentials.IsPasswordClearText.ShouldBeEquivalentTo(source.Credentials.IsPasswordClearText); }
public void Clone_CopiesAllPropertyValuesFromSource() { // Arrange var credentials = new PackageSourceCredential("SourceName", "username", "password", isPasswordClearText: false); var source = new PackageSource("Source", "SourceName", isEnabled: false) { Credentials = credentials, ProtocolVersion = 43 }; // Act var result = source.Clone(); // Assert Assert.Equal(source.Source, result.Source); Assert.Equal(source.Name, result.Name); Assert.Equal(source.IsEnabled, result.IsEnabled); Assert.Equal(source.ProtocolVersion, result.ProtocolVersion); Assert.Same(source.Credentials, result.Credentials); }
public void Clone_CopiesAllPropertyValuesFromSource() { // Arrange var source = new PackageSource("Source", "SourceName", isEnabled: false) { IsPasswordClearText = true, Password = "******", UserName = "******", ProtocolVersion = 43, }; // Act var result = source.Clone(); // Assert Assert.Equal(source.Source, result.Source); Assert.Equal(source.Name, result.Name); Assert.Equal(source.IsEnabled, result.IsEnabled); Assert.Equal(source.ProtocolVersion, result.ProtocolVersion); Assert.Equal(source.UserName, result.UserName); Assert.Equal(source.Password, source.Password); }