Пример #1
0
        public void GetInStructRules()
        {
            var xml =
                @"<configuration>
    <structureAmbiguityRule
      group=""test"">

        <notify
          subject=""Task is present in more than one project structure. Remove it from others.""
          mailTo=""reporter""/>

        <structures>417,462,525,576</structures>
    </structureAmbiguityRule>
</configuration>";

            var config = new XmlRulesConfig(XDocument.Parse(xml), new Mock <ILogger>().Object);

            var rule = config.GetInStructRules("test").Single();

            Assert.AreEqual(string.Join(",", rule.Structures), "417,462,525,576");
            Assert.AreEqual(string.Join(",", rule.HowToNotify !.MetaAddressers), string.Join(",", new[] { "reporter" }));
            Assert.AreEqual(rule.HowToNotify.Subject, "Task is present in more than one project structure. Remove it from others.");
        }