示例#1
0
        public void ByUser()
        {
            AuditFilterBase filter = AuditFilters.ByUser("User #1");

            Assert.IsTrue(filter.CheckFilter(record1), "User not included");
            Assert.IsFalse(filter.CheckFilter(record2), "User not excluded");
        }
示例#2
0
        public void ByUserAndProject()
        {
            AuditFilterBase filter = AuditFilters.ByUser("User #1")
                                     .ByProject("Project #1");

            Assert.IsTrue(filter.CheckFilter(record1), "Project not included");
            Assert.IsFalse(filter.CheckFilter(record3), "Project not excluded");
        }
        public void ReadSomeFilteredEvents()
        {
            FileXmlReader reader = new FileXmlReader();

            reader.AuditFileLocation = GenerateAuditFile();
            List <AuditRecord> records = reader.Read(0, 1, AuditFilters.ByUser("User #1"));

            Assert.AreEqual(1, records.Count, "Incorrect number of records returned");
        }
示例#4
0
        public void Combined()
        {
            AuditFilterBase filter = AuditFilters.Combine(
                AuditFilters.ByProject("Project #1"),
                AuditFilters.ByUser("User #2"));

            Assert.IsTrue(filter.CheckFilter(record1), "Project not included");
            Assert.IsTrue(filter.CheckFilter(record2), "Project not included");
            Assert.IsFalse(filter.CheckFilter(record3), "Project not excluded");
        }