Exemplo n.º 1
0
        public void PermissionEntries()
        {
            PerformanceCounterPermissionAccess          pcpa  = PerformanceCounterPermissionAccess.None;
            PerformanceCounterPermission                pcp   = new PerformanceCounterPermission(pcpa, "localhost", String.Empty);
            PerformanceCounterPermissionEntryCollection pcpec = pcp.PermissionEntries;

            Assert.AreEqual(1, pcpec.Count, "Count==1");

            PerformanceCounterPermissionEntry pcpe = new PerformanceCounterPermissionEntry(PerformanceCounterPermissionAccess.Browse, "*", String.Empty);

            pcp.PermissionEntries.Add(pcpe);
            Assert.AreEqual(2, pcpec.Count, "Count==2");

            // remove (same instance)
            pcp.PermissionEntries.Remove(pcpe);
            Assert.AreEqual(1, pcpec.Count, "Count==1 (b)");

            // remove different instance (doesn't work)
            pcpe = new PerformanceCounterPermissionEntry(PerformanceCounterPermissionAccess.None, "localhost", String.Empty);
            Assert.AreEqual(1, pcpec.Count, "Count==1");
        }
	public void AddRange(PerformanceCounterPermissionEntryCollection value) {}
 public void AddRange(PerformanceCounterPermissionEntryCollection value)
 {
 }