public void UnionWithoutOverride()
        {
            var contextReplacementSet = new XmlTranslationSet {
                Override = false,
                Items    = new[] {
                    new XmlNamespaceTranslation("contextSourceUrn", "contextTargetUrn"),
                    new XmlNamespaceTranslation("commonSourceUrn", "commonTargetUrn")
                }
            };
            var pipelineReplacementSet = new XmlTranslationSet {
                Items = new[] {
                    new XmlNamespaceTranslation("pipelineSourceUrn", "pipelineTargetUrn"),
                    new XmlNamespaceTranslation("commonSourceUrn", "commonTargetUrn")
                }
            };

            contextReplacementSet.Union(pipelineReplacementSet).Should().Be(
                new XmlTranslationSet {
                Override = false,
                Items    = new[] {
                    new XmlNamespaceTranslation("contextSourceUrn", "contextTargetUrn"),
                    new XmlNamespaceTranslation("commonSourceUrn", "commonTargetUrn"),
                    new XmlNamespaceTranslation("pipelineSourceUrn", "pipelineTargetUrn")
                }
            });
        }
 public static string Serialize(XmlTranslationSet translations)
 {
     if (translations == null || !translations.Items.Any())
     {
         return(null);
     }
     using (var stream = new MemoryStream())
         using (var xmlWriter = XmlWriter.Create(stream, new XmlWriterSettings {
             Encoding = new UTF8Encoding(false), Indent = false, OmitXmlDeclaration = true
         }))
         {
             var xmlSerializer = new XmlSerializer(typeof(XmlTranslationSet));
             xmlSerializer.Serialize(
                 xmlWriter,
                 translations,
                 new XmlSerializerNamespaces(new[] { new XmlQualifiedName("xt", XmlTranslationSet.NAMESPACE) }));
             return(Encoding.UTF8.GetString(stream.ToArray()));
         }
 }