本文整理汇总了C#中TestEnvironment.MappedFilePath方法的典型用法代码示例。如果您正苦于以下问题:C# TestEnvironment.MappedFilePath方法的具体用法?C# TestEnvironment.MappedFilePath怎么用?C# TestEnvironment.MappedFilePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestEnvironment
的用法示例。
在下文中一共展示了TestEnvironment.MappedFilePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: using
public void Migrate_LanguageSubtagContainsAmbiguousLanguageOrRegionAndidenticalPrecedingLanguageSubtagExists_MoveAmbiguousTagToRegion()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("de-de", "", "", ""));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='de']");
AssertLdmlHasNoXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/script");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/territory[@type='DE']");
AssertLdmlHasNoXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant");
}
}
示例2: Migrate_OriginalFileContainsLdmlDataWeDontCareAbout_DataIsCopied
public void Migrate_OriginalFileContainsLdmlDataWeDontCareAbout_DataIsCopied()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0WithLdmlInfoWeDontCareAbout("","","",""));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='qaa']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/fallback/testing[text()='fallback']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/measurement/testing[text()='measurement']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/dates/testing[text()='dates']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/units/testing[text()='units']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/listPatterns/testing[text()='listPatterns']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/posix/testing[text()='posix']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/segmentations/testing[text()='segmentations']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/rbnf/testing[text()='rbnf']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/references/testing[text()='references']");
}
}
示例3: Migrate_LanguageSubtagContainsDuplicatePrivateUse_DuplicateIsRemoved
public void Migrate_LanguageSubtagContainsDuplicatePrivateUse_DuplicateIsRemoved()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("bogus", "", "", "x-bogus"));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='qaa']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant[@type='x-bogus']");
}
}
示例4: Migrate_VariantContainsDuplicate_DuplicateIsmovedToPrivateUse
public void Migrate_VariantContainsDuplicate_DuplicateIsmovedToPrivateUse()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("en", "", "", "biske-BiSKe"));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant[@type='biske-x-BiSKe']");
}
}
示例5: Migrate_LanguageSubtagContainsOnlyInvalidData_DataIsMovedToPrivateUseAndLanguageSubtagIsSetToQaa
public void Migrate_LanguageSubtagContainsOnlyInvalidData_DataIsMovedToPrivateUseAndLanguageSubtagIsSetToQaa()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("bogus-stuff", "", "", ""));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='qaa']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant[@type='x-bogus-stuff']");
}
}
示例6: Migrate_VariantContainsMultipleValidVariants_ValidVariantsAreLeftUntouched
public void Migrate_VariantContainsMultipleValidVariants_ValidVariantsAreLeftUntouched()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("en", "", "", "biske-bogus-bauddha"));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='en']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant[@type='biske-bauddha-x-bogus']");
}
}
示例7: Migrate_LanguageSubtagContainsxDashEmic_xDashEmicIsMovedToPrivateUseSubtag
public void Migrate_LanguageSubtagContainsxDashEmic_xDashEmicIsMovedToPrivateUseSubtag()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("en-fonipa-x-emic", "", "", ""));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='en']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant[@type='fonipa-x-emic']");
}
}
示例8: Migrate_RepoContainsMultipleDuplicatesEn_DuplicatesAreRenamedAndMarkedCorrectly
public void Migrate_RepoContainsMultipleDuplicatesEn_DuplicatesAreRenamedAndMarkedCorrectly()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("bogus.ldml", LdmlContentForTests.Version1("en", "", "", ""));
environment.WriteLdmlFile("bogus1.ldml", LdmlContentForTests.Version1("en", "Latn", "", ""));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
Assert.True(File.Exists(environment.MappedFilePath("bogus.ldml")));
Assert.True(File.Exists(environment.MappedFilePath("bogus1.ldml")));
AssertLdmlHasXpath(environment.MappedFilePath("bogus.ldml"), "/ldml/identity/language[@type='en']");
AssertLdmlHasXpath(environment.MappedFilePath("bogus1.ldml"), "/ldml/identity/language[@type='en']");
AssertLdmlHasNoXpath(environment.MappedFilePath("bogus1.ldml"), "/ldml/identity/script");
AssertLdmlHasXpath(environment.MappedFilePath("bogus1.ldml"), "/ldml/identity/variant[@type='x-dupl0']");
}
}
示例9: Migrate_FileIsVersion0_IsMigratedToLatestVersion
public void Migrate_FileIsVersion0_IsMigratedToLatestVersion()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("en", "", "", ""));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
Assert.AreEqual(LdmlDataMapper.CurrentLdmlVersion, environment.GetFileVersion(environment.MappedFilePath("test.ldml")));
}
}
示例10: Migrate_VariantSubtagContainsZxxx_RfctagisConvertedToAudio
public void Migrate_VariantSubtagContainsZxxx_RfctagisConvertedToAudio()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("en", "", "", "Zxxx"));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='en']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/script[@type='Zxxx']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant[@type='x-audio']");
}
}
示例11: Migrate_RegionContainsTagThatIsValidRegion_IsMigrated
public void Migrate_RegionContainsTagThatIsValidRegion_IsMigrated()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("en", "", "DE", ""));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='en']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/territory[@type='DE']");
}
}
示例12: Migrate_LanguageSubtagIsIso3Code_UseIso1Code
public void Migrate_LanguageSubtagIsIso3Code_UseIso1Code()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("eng", String.Empty, String.Empty, String.Empty));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='en']");
}
}
示例13: Migrate_LanguageSubtagContainsValidVariant_VariantIsMovedToVariant
public void Migrate_LanguageSubtagContainsValidVariant_VariantIsMovedToVariant()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("en-1901", String.Empty, String.Empty, String.Empty));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='en']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant[@type='1901']");
}
}
示例14: Migrate_LanguageSubtagAndRegionSubtagContainValidDuplicates_DataIsNotDuplicatedInPrivateUse
public void Migrate_LanguageSubtagAndRegionSubtagContainValidDuplicates_DataIsNotDuplicatedInPrivateUse()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("de", "", "DE", ""));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='de']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/territory[@type='DE']");
AssertLdmlHasNoXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant");
}
}
示例15: Migrate_LanguageSubtagContainsx_xIsNotDuplicated
public void Migrate_LanguageSubtagContainsx_xIsNotDuplicated()
{
using (var environment = new TestEnvironment())
{
environment.WriteLdmlFile("test.ldml", LdmlContentForTests.Version0("en-x-audio", String.Empty, String.Empty, "x-test"));
var migrator = new LdmlInFolderWritingSystemRepositoryMigrator(environment.LdmlPath, environment.OnMigrateCallback);
migrator.Migrate();
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/language[@type='en']");
AssertLdmlHasXpath(environment.MappedFilePath("test.ldml"), "/ldml/identity/variant[@type='x-audio-test']");
}
}