コード例 #1
0
        public static void AdditionalTestCases()
        {
            bool isContainer = false;
            bool isDS        = false;

            RawAcl    rawAcl    = null;
            SystemAcl systemAcl = null;

            byte revision = 0;
            int  capacity = 0;

            //case 1, null Sid


            Assert.Throws <ArgumentNullException>(() =>
            {
                revision    = 127;
                capacity    = 1;
                rawAcl      = new RawAcl(revision, capacity);
                isContainer = true;
                isDS        = false;
                systemAcl   = new SystemAcl(isContainer, isDS, rawAcl);
                systemAcl.Purge(null);
            });
        }
コード例 #2
0
        private static bool TestPurge(SystemAcl systemAcl, SecurityIdentifier sid, int aceCount)
        {
            KnownAce ace = null;

            systemAcl.Purge(sid);
            if (aceCount != systemAcl.Count)
            {
                return(false);
            }
            for (int i = 0; i < systemAcl.Count; i++)
            {
                ace = systemAcl[i] as KnownAce;
                if (ace != null && ((ace.AceFlags & AceFlags.Inherited) == 0))
                {
                    if (ace.SecurityIdentifier == sid)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
コード例 #3
0
ファイル: SystemAcl_Purge.cs プロジェクト: ChuangYang/corefx
 private static bool TestPurge(SystemAcl systemAcl, SecurityIdentifier sid, int aceCount)
 {
     KnownAce ace = null;
     systemAcl.Purge(sid);
     if (aceCount != systemAcl.Count)
         return false;
     for (int i = 0; i < systemAcl.Count; i++)
     {
         ace = systemAcl[i] as KnownAce;
         if (ace != null && ((ace.AceFlags & AceFlags.Inherited) == 0))
         {
             if (ace.SecurityIdentifier == sid)
                 return false;
         }
     }
     return true;
 }
コード例 #4
0
ファイル: SystemAcl_Purge.cs プロジェクト: ChuangYang/corefx
        public static void AdditionalTestCases()
        {
            bool isContainer = false;
            bool isDS = false;

            RawAcl rawAcl = null;
            SystemAcl systemAcl = null;

            byte revision = 0;
            int capacity = 0;
            //case 1, null Sid


            Assert.Throws<ArgumentNullException>(() =>
            {
                revision = 127;
                capacity = 1;
                rawAcl = new RawAcl(revision, capacity);
                isContainer = true;
                isDS = false;
                systemAcl = new SystemAcl(isContainer, isDS, rawAcl);
                systemAcl.Purge(null);
            });
        }