Пример #1
0
        public void ToDirectoryModification_SecurityIdentifier_ReturnsCorrectAttribute()
        {
            var bytes = new byte[]
            {
                1, 5, 0, 0, 27, 14, 3, 139, 251, 73, 97, 48, 157, 6, 235, 192, 201,
                125, 33, 65, 182, 209, 6, 82, 206, 165, 32, 24
            };
            object o = new SecurityIdentifier(bytes, 0);

            var modification = o.ToDirectoryModification("x", DirectoryAttributeOperation.Replace);

            modification.Name.Should().Be.EqualTo("x");
            modification.Count.Should().Be.EqualTo(1);
            modification[0].As <byte[]>().Should().Have.SameSequenceAs(bytes);
            modification.Operation.Should().Be.EqualTo(DirectoryAttributeOperation.Replace);
        }