Exemple #1
0
        public void BuildXmlTranslationSetWithTranslationInContext()
        {
            MessageMock.Setup(c => c.GetProperty(BizTalkFactoryProperties.XmlTranslations))
            .Returns(
                XmlTranslationSetConverter.Serialize(
                    new XmlTranslationSet {
                Override = true,
                Items    = new[] {
                    new XmlNamespaceTranslation("sourceUrn5", "urn05")
                }
            }));

            var sut = new XmlTranslator {
                Translations = new XmlTranslationSet {
                    Override = false,
                    Items    = new[] {
                        new XmlNamespaceTranslation("sourceUrn1", "urn:test1"),
                        new XmlNamespaceTranslation("sourceUrn2", "urn:test2")
                    }
                }
            };

            Assert.That(
                sut.BuildXmlTranslationSet(MessageMock.Object),
                Is.EqualTo(
                    new XmlTranslationSet {
                Override = true,
                Items    = new[] {
                    new XmlNamespaceTranslation("sourceUrn5", "urn05")
                }
            }));
        }
Exemple #2
0
        public void BuildXmlTranslationSetWithNoTranslationInContext()
        {
            var sut = new XmlTranslator {
                Translations = new XmlTranslationSet {
                    Override = false,
                    Items    = new[] {
                        new XmlNamespaceTranslation("sourceUrn1", "urn:test1"),
                        new XmlNamespaceTranslation("sourceUrn5", "urn:test5")
                    }
                }
            };

            Assert.That(
                sut.BuildXmlTranslationSet(MessageMock.Object),
                Is.EqualTo(
                    new XmlTranslationSet {
                Override = false,
                Items    = new[] {
                    new XmlNamespaceTranslation("sourceUrn1", "urn:test1"),
                    new XmlNamespaceTranslation("sourceUrn5", "urn:test5")
                }
            }));
        }