예제 #1
0
        public void ReplaceUrlOnNonLavaString()
        {
            LegacyLavaUpdater legacyLavaUpdater = new LegacyLavaUpdater();
            bool isUpdated = false;

            string beforeText = @"This should not get changed query_strings_from_url {{ Person | Attribute: ''Facebook'', ''Url'' }}";
            string afterText  = legacyLavaUpdater.ReplaceUrl(beforeText, ref isUpdated);

            Assert.Equal(beforeText, afterText);
        }
예제 #2
0
        public void ReplaceMultipleUrlOnLavaString()
        {
            LegacyLavaUpdater legacyLavaUpdater = new LegacyLavaUpdater();
            bool isUpdated = false;

            string beforeText   = "<p>_url Legacy Lava {{ Person.Facebook_url }} {{ Person.Twitter_url }} {{ Person.SnapChat_url }} {{ Person.Instagram_url }} Legacy Lava </p>";
            string expectedText = "<p>_url Legacy Lava {{ Person.Facebook,'Url' }} {{ Person.Twitter,'Url' }} {{ Person.SnapChat,'Url' }} {{ Person.Instagram,'Url' }} Legacy Lava </p>";

            string afterText = legacyLavaUpdater.ReplaceUrl(beforeText, ref isUpdated);

            Assert.Equal(expectedText, afterText);
        }
예제 #3
0
        public void ReplaceUrlOnLavaString()
        {
            LegacyLavaUpdater legacyLavaUpdater = new LegacyLavaUpdater();
            bool isUpdated = false;

            string beforeText   = "<p>_url Legacy Lava {{ Person.Facebook_url }} Legacy Lava </p>";
            string expectedText = "<p>_url Legacy Lava {{ Person.Facebook,'Url' }} Legacy Lava </p>";

            string afterText = legacyLavaUpdater.ReplaceUrl(beforeText, ref isUpdated);

            Assert.That.Equal(expectedText, afterText);
        }