Example #1
0
        public void TextObjectSetPropertyTest()
        {
            const string source     = "abc=123; def=789";
            var          textObject = new TextObject(source);

            // replace the first occurrence of = followed by a number of digits
            Assert.IsTrue(textObject.SetProperty("(?:=(\\d+))", "456"));
            Assert.AreEqual("abc=456; def=789", textObject.Serialize());

            // regex should not match, so it should not change anything
            Assert.IsFalse(textObject.SetProperty("(?:ghi=(\\d+))", "456"));
            Assert.AreEqual("abc=456; def=789", textObject.Serialize());
        }