Example #1
0
        public void CreateWellKnownSid_Everyone()
        {
            SID sid = Security.CreateWellKnownSid(WellKnownSID.World);

            sid.IsValidSid().Should().BeTrue();
            sid.Revision.Should().Be(1);
            sid.IdentifierAuthority.Should().Be(IdentifierAuthority.World);

            sid.GetSidSubAuthorityCount().Should().Be(1);
            sid.GetSidSubAuthority(0).Should().Be(0);

            sid.IsWellKnownSid(WellKnownSID.World).Should().BeTrue();
            sid.ConvertSidToString().Should().Be("S-1-1-0");

            AccountSidInformation info = sid.LookupAccountSid();

            info.Name.Should().Be("Everyone");
            info.DomainName.Should().Be("");
            info.Usage.Should().Be(SidNameUse.WellKnownGroup);
        }