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") } } }; sut.BuildXmlTranslationSet(MessageMock.Object).Should().Be( new XmlTranslationSet { Override = true, Items = new[] { new XmlNamespaceTranslation("sourceUrn5", "urn05") } }); }
/// <summary> /// Saves the current component configuration into the property bag /// </summary> /// <param name="propertyBag">Configuration property bag</param> protected override void Save(IPropertyBag propertyBag) { propertyBag.WriteProperty("Encoding", EncodingConverter.Serialize(Encoding)); propertyBag.WriteProperty("Modes", Modes); propertyBag.WriteProperty("Translations", XmlTranslationSetConverter.Serialize(Translations)); }