public void DeserializeNamingConvention() { var data = "{papal_influence=2.500}"; var actual = ParadoxParser.Deserialize <FooNamingConvention>(data.ToStream()); Assert.Equal(2.500, actual.PapalInfluence); }
public void DeserializeAliases() { var data = "{Bar=You}"; var actual = ParadoxParser.Deserialize <FooAlias>(data.ToStream()); Assert.Equal("You", actual.Name); }
public void DeserializeIParadoxReads() { string data = "{value=4 value=5}"; var actual = ParadoxParser.Deserialize <Foo2>(data.ToStream()); Assert.Equal(6, actual.value); }
public void DeserializeStringIEnumerable() { string data = "{me {you them} us} #hehe"; IEnumerable <string> expected = new[] { "me", "you", "them", "us" }; var actual = ParadoxParser.Deserialize <IEnumerable <string> >(data.ToStream()); Assert.Equal(expected, actual); }
public void DeserializeStringCollection() { string data = "{me {you them} us} #hehe"; ICollection <string> expected = new[] { "me", "you", "them", "us" }; ICollection <string> actual = ParadoxParser.Deserialize <ICollection <string> >(data.ToStream()); Assert.Equal(expected, actual); }
public void DeserializeIntArray() { string data = "{1, 2 -1, 0 3}"; int[] expected = { 1, 2, -1, 0, 3 }; int[] actual = ParadoxParser.Deserialize <int[]>(data.ToStream()); Assert.Equal(expected, actual); }
public void DeserializeStringArray() { string data = "{me {you them} us} #hehe"; string[] expected = { "me", "you", "them", "us" }; string[] actual = ParadoxParser.Deserialize <string[]>(data.ToStream()); Assert.Equal(expected, actual); }
public void DeserializeObjects() { string data = "{value=\"Hey\" bar={id=4}}"; var actual = ParadoxParser.Deserialize <Foo>(data.ToStream()); Assert.Equal("Hey", actual.value); Assert.Equal(4, actual.bar.id); }
public void DeserializeStringList() { string data = "{me {you them} us} #hehe"; var expected = new List <string> { "me", "you", "them", "us" }; var actual = ParadoxParser.Deserialize <List <string> >(data.ToStream()); Assert.Equal(expected, actual); }
public void DeserializeWithoutInitialCurly() { string data = "me=1.000 you=2.500 #hehe"; var expected = new Dictionary <string, double> { { "me", 1.000 }, { "you", 2.500 } }; var actual = ParadoxParser.Deserialize <IDictionary <string, double> >(data.ToStream()); Assert.Equal(expected, actual); }
public void DeserializeNullable() { int?actual = ParadoxParser.Deserialize <int?>("1".ToStream()); Assert.Equal(1, actual); }
public void DeserializeDates(string data, DateTime expected) { DateTime actual = ParadoxParser.Deserialize <DateTime>(data.ToStream()); Assert.Equal(expected, actual); }
public void DesrializeTest <T>(string data, T expected) { T actual = ParadoxParser.Deserialize <T>(data.ToStream()); Assert.Equal(expected, actual); }