public void Convert_Empty() { LocalizedName[] localizedNames = new LocalizedName[0]; MetadataLocalizationToXmlConverter converter = new MetadataLocalizationToXmlConverter(); XmlDocument document = converter.Convert(localizedNames, "de"); string expectedXml = @"<?xml version=""1.0""?> <localizedNames xmlns=""http://www.re-motion.org/Security/Metadata/Localization/1.0"" culture=""de"" /> "; XmlAssert.AreDocumentsEqual(expectedXml, document); }
public void Convert_OneLocalizedNameForInvariantCulture() { LocalizedName[] localizedNames = new LocalizedName[1]; localizedNames[0] = new LocalizedName("b8621bc9-9ab3-4524-b1e4-582657d6b420", "Clerk|Remotion.Security.UnitTests.TestDomain.DomainAbstractRoles, Remotion.Security.UnitTests.TestDomain", "Beamter"); MetadataLocalizationToXmlConverter converter = new MetadataLocalizationToXmlConverter(); XmlDocument document = converter.Convert(localizedNames, CultureInfo.InvariantCulture.Name); string expectedXml = @"<?xml version=""1.0""?> <localizedNames xmlns=""http://www.re-motion.org/Security/Metadata/Localization/1.0"" culture=""""> <localizedName ref=""b8621bc9-9ab3-4524-b1e4-582657d6b420"" comment=""Clerk|Remotion.Security.UnitTests.TestDomain.DomainAbstractRoles, Remotion.Security.UnitTests.TestDomain""> Beamter </localizedName> </localizedNames> "; XmlAssert.AreDocumentsEqual(expectedXml, document); }
public void Convert_TwoLocalizedNames() { LocalizedName[] localizedNames = new LocalizedName[2]; localizedNames[0] = new LocalizedName("b8621bc9-9ab3-4524-b1e4-582657d6b420", "Clerk|Remotion.Security.UnitTests.TestDomain.DomainAbstractRoles, Remotion.Security.UnitTests.TestDomain", "Beamter"); localizedNames[1] = new LocalizedName("93969f13-65d7-49f4-a456-a1686a4de3de", "Confidentiality", "Vertraulichkeit"); MetadataLocalizationToXmlConverter converter = new MetadataLocalizationToXmlConverter(); XmlDocument document = converter.Convert(localizedNames, "de"); string expectedXml = @"<?xml version=""1.0""?> <localizedNames xmlns=""http://www.re-motion.org/Security/Metadata/Localization/1.0"" culture=""de""> <localizedName ref=""b8621bc9-9ab3-4524-b1e4-582657d6b420"" comment=""Clerk|Remotion.Security.UnitTests.TestDomain.DomainAbstractRoles, Remotion.Security.UnitTests.TestDomain""> Beamter </localizedName> <localizedName ref=""93969f13-65d7-49f4-a456-a1686a4de3de"" comment=""Confidentiality""> Vertraulichkeit </localizedName> </localizedNames> "; XmlAssert.AreDocumentsEqual(expectedXml, document); }