コード例 #1
0
        public void TestSimpleMapping()
        {
            var config = XDocument.Parse(
                @"
<root>
    <redirection_rules>
        <rule from=""Ivanov"" to=""Petrov""/>
    </redirection_rules>
</root>
");

            var logger         = new Mock <ILogger>().Object;
            var redirector     = new Redirector(new XmlRulesConfig(config, logger).GetRedirectionMap(), Enumerable.Empty <string>(), Enumerable.Empty <string>());
            var initialMessage = new Message {
                To = "ivanov"
            };
            var actualizedMessage = redirector.ActualizeAddressees(initialMessage);

            Assert.AreEqual("Petrov", actualizedMessage.To);
        }