public void PermissionEntries()
        {
            EventLogPermissionAccess          elpa  = EventLogPermissionAccess.None;
            EventLogPermission                elp   = new EventLogPermission(elpa, "localhost");
            EventLogPermissionEntryCollection elpec = elp.PermissionEntries;

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

            EventLogPermissionEntry elpe = new EventLogPermissionEntry(EventLogPermissionAccess.Browse, "*");

            elp.PermissionEntries.Add(elpe);
            Assert.AreEqual(2, elpec.Count, "Count==2");

            // remove (same instance)
            elp.PermissionEntries.Remove(elpe);
            Assert.AreEqual(1, elpec.Count, "Count==1 (b)");

            // remove different instance (doesn't work)
            elpe = new EventLogPermissionEntry(EventLogPermissionAccess.None, "localhost");
            Assert.AreEqual(1, elpec.Count, "Count==1");
        }
Exemplo n.º 2
0
 public void AddRange(EventLogPermissionEntryCollection value)
 {
 }
	public void AddRange(EventLogPermissionEntryCollection value) {}