Пример #1
0
        public void FilteringIsNotAppliedToSensitiveKeysWithEmptyValues()
        {
            var filter = new RaygunXmlDataFilter();

            var xml = LoadPayload("BasicWithoutValues.xml");

            var filteredData = filter.Filter(xml, new List <string>()
            {
                "password"
            });

            Assert.NotNull(filteredData);
            Assert.NotNull(XDocument.Parse(filteredData));// Check if it can still be parsed.
            Assert.AreEqual(filteredData, "<user><name>Ronald</name><password></password></user>");
        }
Пример #2
0
        public void FilteringIsNotAppliedToElementsWithAttributesWithSensitiveKeysWithEmptyValues()
        {
            var filter = new RaygunXmlDataFilter();

            var xml = LoadPayload("AttributedWithoutValues.xml");

            var filteredData = filter.Filter(xml, new List <string>()
            {
                "password"
            });

            Assert.NotNull(filteredData);
            Assert.NotNull(XDocument.Parse(filteredData));// Check if it can still be parsed.
            Assert.AreEqual(filteredData, "<root><raygunsettings apikey=\"123456\" /><user name=\"Raygun\" password=\"\" /></root>");
        }
Пример #3
0
        public void FilteringIsAppliedToElementsWithSensitiveKeysWithValuesIgnoringCase()
        {
            var filter = new RaygunXmlDataFilter();

            var xml = LoadPayload("BasicWithValues.xml");

            var filteredData = filter.Filter(xml, new List <string>()
            {
                "PaSsWoRd"
            });

            Assert.NotNull(filteredData);
            Assert.NotNull(XDocument.Parse(filteredData));// Check if it can still be parsed.
            Assert.AreEqual(filteredData, "<user><name>Ronald</name><password>[FILTERED]</password></user>");
        }