public void Read_ValidXml_SetsAllProperties()
        {
            const string projectSettingsXml =
                @"<ProjectLexiconSettings>
  <WritingSystems>
    <WritingSystem id=""qaa-Qaaa-QM-x-kal-Fake-ZG-var1-var2"">
      <Abbreviation>kal</Abbreviation>
      <LanguageName>Kalaba</LanguageName>
      <ScriptName>Fake</ScriptName>
      <RegionName>Zolrog</RegionName>
      <SystemCollation>snarf</SystemCollation>
    </WritingSystem>
    <WritingSystem id=""fr-FR"">
      <SpellCheckingId>fr_FR</SpellCheckingId>
      <LegacyMapping>converter</LegacyMapping>
      <Keyboard>Old Keyboard</Keyboard>
    </WritingSystem>
  </WritingSystems>
</ProjectLexiconSettings>";

            var projectSettingsDataMapper = new ProjectLexiconSettingsWritingSystemDataMapper(new MemorySettingsStore {
                SettingsElement = XElement.Parse(projectSettingsXml)
            });

            var ws1 = new WritingSystemDefinition("qaa-Qaaa-QM-x-kal-Fake-ZG-var1-var2");

            projectSettingsDataMapper.Read(ws1);

            Assert.That(ws1.Abbreviation, Is.EqualTo("kal"));
            Assert.That(ws1.Language.Name, Is.EqualTo("Kalaba"));
            Assert.That(ws1.Script.Name, Is.EqualTo("Fake"));
            Assert.That(ws1.Region.Name, Is.EqualTo("Zolrog"));
            Assert.That(ws1.SpellCheckingId, Is.EqualTo(string.Empty));
            Assert.That(ws1.LegacyMapping, Is.EqualTo(string.Empty));
            Assert.That(ws1.Keyboard, Is.EqualTo(string.Empty));
            var scd = new SystemCollationDefinition {
                LanguageTag = "snarf"
            };

            Assert.That(ws1.DefaultCollation, Is.ValueEqualTo(scd));

            var ws2 = new WritingSystemDefinition("fr-FR");

            projectSettingsDataMapper.Read(ws2);

            Assert.That(ws2.Abbreviation, Is.EqualTo("fr"));
            Assert.That(ws2.Language.Name, Is.EqualTo("French"));
            Assert.That(ws2.Script.Name, Is.EqualTo("Latin"));
            Assert.That(ws2.Region.Name, Is.EqualTo("France"));
            Assert.That(ws2.Variants, Is.Empty);
            Assert.That(ws2.SpellCheckingId, Is.EqualTo("fr_FR"));
            Assert.That(ws2.LegacyMapping, Is.EqualTo("converter"));
            Assert.That(ws2.Keyboard, Is.EqualTo("Old Keyboard"));

            var ws3 = new WritingSystemDefinition("es");

            projectSettingsDataMapper.Read(ws3);

            Assert.That(ws3.Abbreviation, Is.EqualTo("es"));
            Assert.That(ws3.Language.Name, Is.EqualTo("Spanish"));
            Assert.That(ws3.Script.Name, Is.EqualTo("Latin"));
            Assert.That(ws3.Region, Is.Null);
            Assert.That(ws3.Variants, Is.Empty);
            Assert.That(ws3.SpellCheckingId, Is.EqualTo(string.Empty));
            Assert.That(ws3.LegacyMapping, Is.EqualTo(string.Empty));
            Assert.That(ws3.Keyboard, Is.EqualTo(string.Empty));
        }