public void NLSMap_SerializeAll() { var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}"; var nls = new NLSMap(content); var json = nls.ToJSON(); Console.WriteLine(json); dynamic read = json.JSONToDynamic(); Aver.IsNotNull(read); Aver.AreEqual("Cucumber", read.ENG.n); Aver.AreEqual("Gurke", read.DEU.n); }
public void NLSMap_SerializeAll() { var content = "eng{n='Cucumber' d='It is green'} deu{n='Gurke' d='Es ist grün'}"; var nls = new NLSMap(content); var json = nls.ToJSON(); Console.WriteLine(json); dynamic read = json.JSONToDynamic(); Assert.IsNotNull(read); Assert.AreEqual("Cucumber", read.eng.n); Assert.AreEqual("Gurke", read.deu.n); }
public void NLSMap_JSONSerializationRoundtrip() { var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}"; var nls = new NLSMap(content); var json = nls.ToJSON(); Console.WriteLine(json); var nls2 = new NLSMap(json); Aver.AreEqual(2, nls2.Count); Aver.AreEqual("Cucumber", nls2["eng"].Name); Aver.AreEqual("Gurke", nls2["deu"].Name); Aver.AreEqual(null, nls["rus"].Name); }
public void NLSMap_SerializeOnlyOneNoneExisting() { var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}"; var nls = new NLSMap(content); var options = new JSONWritingOptions { NLSMapLanguageISO = "rus", Purpose = JSONSerializationPurpose.UIFeed }; var json = nls.ToJSON(options); Console.WriteLine(json); dynamic read = json.JSONToDynamic(); Aver.IsNotNull(read); Aver.AreEqual("Cucumber", read.n); Aver.AreEqual("It is green", read.d); }
public void NLSMap_SerializeOnlyOneExisting() { var content = "eng{n='Cucumber' d='It is green'} deu{n='Gurke' d='Es ist grün'}"; var nls = new NLSMap(content); var options = new JSONWritingOptions { NLSMapLanguageISO = "deu", Purpose = JSONSerializationPurpose.UIFeed }; var json = nls.ToJSON(options); Console.WriteLine(json); dynamic read = json.JSONToDynamic(); Assert.IsNotNull(read); Assert.AreEqual("Gurke", read.n); Assert.AreEqual("Es ist grün", read.d); }
public void NLSMap_SerializeOnlyOneNoneExisting() { var content="{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}"; var nls = new NLSMap(content); var options = new JSONWritingOptions{ NLSMapLanguageISO = "rus", Purpose = JSONSerializationPurpose.UIFeed}; var json = nls.ToJSON(options); Console.WriteLine(json); dynamic read = json.JSONToDynamic(); Assert.IsNotNull(read); Assert.AreEqual("Cucumber", read.n); Assert.AreEqual("It is green", read.d); }
public void NLSMap_SerializeAll() { var content="{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}"; var nls = new NLSMap(content); var json = nls.ToJSON(); Console.WriteLine(json); dynamic read = json.JSONToDynamic(); Assert.IsNotNull(read); Assert.AreEqual("Cucumber", read.eng.n); Assert.AreEqual("Gurke", read.deu.n); }