public void ShouldReplaceAllValues() { // Arrange. ModSpec[] modSpec = { new ModSpec(ModSpecType.Replace, "telephonenumber", null) }; string dump = string.Join( Environment.NewLine, "dn: CN=Leonardo Pisano Bigollo,OU=users,DC=company,DC=com", "changetype: modify", "replace: telephonenumber", "-", string.Empty); // Act. ChangeModify sut = new ChangeModify(DistinguishedName, modSpec); // Assert. Assert.Equal(dump, sut.Dump()); }
public void ShouldDeleteSingleValues() { // Arrange. ModSpec[] modSpec = { new ModSpec(ModSpecType.Delete, "description", new object[] { "Contractor" }) }; string dump = string.Join( Environment.NewLine, "dn: CN=Leonardo Pisano Bigollo,OU=users,DC=company,DC=com", "changetype: modify", "delete: description", "description: Contractor", "-", string.Empty); // Act. ChangeModify sut = new ChangeModify(DistinguishedName, modSpec); // Assert. Assert.Equal(dump, sut.Dump()); }
public void ShouldAddOneValue() { // Arrange. ModSpec[] modSpec = { new ModSpec(ModSpecType.Add, "postaladdress", new object[] { "2400 Fulton St, San Francisco, CA 94118, USA" }) }; string dump = string.Join( Environment.NewLine, "dn: CN=Leonardo Pisano Bigollo,OU=users,DC=company,DC=com", "changetype: modify", "add: postaladdress", "postaladdress: 2400 Fulton St, San Francisco, CA 94118, USA", "-", string.Empty); // Act. ChangeModify sut = new ChangeModify(DistinguishedName, modSpec); // Assert. Assert.Equal(dump, sut.Dump()); }