Example #1
0
    public void DeserializeMultipleInstances()
    {
        const string input  = @"Count,Flag,Description
5,true,""This is the description""
10,false,""This is another description""";
        var          result = CsvConvert.DeserializeList <SimpleExample>(input).ToList();

        Assert.That(result.Count, Is.EqualTo(2));
        Assert.That(result[0].Count, Is.EqualTo(5));
        Assert.That(result[0].Flag, Is.True);
        Assert.That(result[0].Description, Is.EqualTo("This is the description"));
        Assert.That(result[1].Count, Is.EqualTo(10));
        Assert.That(result[1].Flag, Is.False);
        Assert.That(result[1].Description, Is.EqualTo("This is another description"));
    }