Exemple #1
0
        public void EscapeUnescapeAnotherTest()
        {
            var source  = @"\|\\d|a|\\s\s\\p|@@\fd|\pp||\\\p\p";
            var escaped = DiscoveryMetadataHelper.Escape(source);

            Assert.AreNotEqual(source, escaped);

            var unescaped = DiscoveryMetadataHelper.Unescape(escaped);

            Assert.AreEqual(source, unescaped);
        }
Exemple #2
0
        public void EscapeUnescapeTests()
        {
            var source  = @"Something\ wonderful| is h@ppening";
            var escaped = DiscoveryMetadataHelper.Escape(source);

            Assert.AreEqual(@"Something\s wonderful\p is h\appening", escaped);

            var unescaped = DiscoveryMetadataHelper.Unescape(escaped);

            Assert.AreEqual(source, unescaped);
        }
Exemple #3
0
        public void EscapeUnescapeNulls()
        {
            var escaped = DiscoveryMetadataHelper.Escape(null);

            Assert.AreEqual("@", escaped);

            var unescaped = DiscoveryMetadataHelper.Unescape("@");

            Assert.IsNull(unescaped);

            unescaped = DiscoveryMetadataHelper.Unescape(null);
            Assert.IsNull(unescaped);
        }