Esempio n. 1
0
        public void TestProcessWithLock()
        {
            var processor = new RepeaterProcessor();

            processor.DataReader  = this.dataReader.Object;
            processor.RepeaterTag = new RepeaterTag
            {
                Source              = this.xPath,
                StartRepeater       = this.startRepeater,
                EndRepeater         = this.endRepeater,
                MakeElementCallback = MakeElementCallback
            };
            processor.CreateDynamicContentTags = true;

            processor.Process();

            var dynamicContentTags =
                this.body.Elements(WordMl.SdtName)
                .Where(
                    element =>
                    element.Element(WordMl.SdtPrName)
                    .Element(WordMl.TagName)
                    .Attribute(WordMl.ValAttributeName)
                    .Value.ToLower()
                    .Equals("dynamiccontent"));

            Assert.IsTrue(dynamicContentTags.Any());
            Assert.AreEqual(1, dynamicContentTags.Count());

            this.CheckRepeaterContent(dynamicContentTags.First().Element(WordMl.SdtContentName));
        }
Esempio n. 2
0
        public void TestProcess()
        {
            var processor = new RepeaterProcessor();

            processor.DataReader  = this.dataReader.Object;
            processor.RepeaterTag = new RepeaterTag
            {
                Source              = this.xPath,
                StartRepeater       = this.startRepeater,
                EndRepeater         = this.endRepeater,
                MakeElementCallback = MakeElementCallback
            };

            processor.Process();

            var dynamicContentTags =
                this.body.Elements(WordMl.SdtName)
                .Where(
                    element =>
                    element.Element(WordMl.SdtPrName)
                    .Element(WordMl.TagName)
                    .Attribute(WordMl.ValAttributeName)
                    .Value.ToLower()
                    .Equals("dynamiccontent"));

            Assert.IsFalse(dynamicContentTags.Any());
            Console.WriteLine(body.ToString());

            this.CheckRepeaterContent(this.body);
        }