public void ToDirectoryAttribute_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 attribute = o.ToDirectoryAttribute("x"); attribute.Name.Should().Be.EqualTo("x"); attribute.Count.Should().Be.EqualTo(1); attribute[0].As <byte[]>().Should().Have.SameSequenceAs(bytes); }