예제 #1
0
        public void BreachAgeCriteria_WhenInstantiated_ViaXml_Returns_Correct_Values()
        {
            string            xml = "<BreachAgeCriteria><BreachAgeGeneralCriteriaSection session=\"New\" session-id=\"2\" show-breach-ages=\"true\" show-overridden-breaches=\"true\" show-rule-groups=\"false\" /></BreachAgeCriteria>";
            BreachAgeCriteria breachAgeCriteria = new BreachAgeCriteria(xml, new SectionedCriteriaSerializer());

            Assert.AreEqual(ComplianceSession.New, breachAgeCriteria.Session);
            Assert.AreEqual(2, breachAgeCriteria.SessionId);
            Assert.AreEqual(true, breachAgeCriteria.ShowBreachAges);
            Assert.AreEqual(true, breachAgeCriteria.ShowOverriddenBreaches);
            Assert.AreEqual(false, breachAgeCriteria.ShowRuleGroups);
        }
예제 #2
0
        public void BreachAgeCriteria_WhenInstantiatedAndSerialized_Returns_SingleClosedXmlTag()
        {
            BreachAgeCriteria breachAgeCriteria = new BreachAgeCriteria(new SectionedCriteriaSerializer());

            breachAgeCriteria.Session                = ComplianceSession.New;
            breachAgeCriteria.SessionId              = 2;
            breachAgeCriteria.ShowBreachAges         = true;
            breachAgeCriteria.ShowOverriddenBreaches = true;
            breachAgeCriteria.ShowRuleGroups         = false;

            string expectedXml  = CompactXml("<BreachAgeCriteria><BreachAgeGeneralCriteriaSection session=\"New\" session-id=\"2\" show-breach-ages=\"true\" show-overridden-breaches=\"true\" show-rule-groups=\"false\" /></BreachAgeCriteria>");
            string generatedXml = CompactXml(breachAgeCriteria.Serialize());

            Assert.AreEqual(expectedXml, generatedXml);
        }