public void JsonSerialiser_WriteObject_Writes_Lists_Of_ValueTypes_Correctly() { var worksheet = new ExcelWorksheetData(TestContext); var container = new ValueListContainer(); if (worksheet.EString("Value1") != null) { var list = new List <int>(); for (int column = 1; column <= 3; ++column) { var name = String.Format("Value{0}", column); if (String.IsNullOrEmpty(worksheet.EString(name))) { continue; } list.Add(worksheet.Int(name)); } container.List = list; } _JsonSerialiser.Initialise(typeof(ValueListContainer)); _JsonSerialiser.WriteObject(_Stream, container); Assert.AreEqual(worksheet.EString("Json"), GetJson()); }
public void JsonSerialiser_WriteObject_Writes_Lists_Of_ValueTypes_Correctly() { var worksheet = new ExcelWorksheetData(TestContext); var container = new ValueListContainer(); if(worksheet.EString("Value1") != null) { var list = new List<int>(); for(int column = 1;column <= 3;++column) { var name = String.Format("Value{0}", column); if(String.IsNullOrEmpty(worksheet.EString(name))) continue; list.Add(worksheet.Int(name)); } container.List = list; } _JsonSerialiser.Initialise(typeof(ValueListContainer)); _JsonSerialiser.WriteObject(_Stream, container); Assert.AreEqual(worksheet.EString("Json"), GetJson()); }