示例#1
0
        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());
        }
示例#2
0
        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());
        }
示例#3
0
        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());
        }