Skip to content

Commit

Permalink
Add tests from readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Feb 25, 2022
1 parent 9d55470 commit 60b7333
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Tomlyn.Tests/ModelTests/ReflectionModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ namespace Tomlyn.Tests
{
public class ModelTests
{
[Test]
public void TestSampleModel()
{
var toml = @"global = ""this is a string""
# This is a comment of a table
[my_table]
key = 1 # Comment a key
value = true
list = [4, 5, 6]
";

// Converts the TOML string to a `TomlTable`
var model = Toml.ToModel(toml);
Assert.AreEqual("this is a string", model["global"]);
}


/// <summary>
/// Serialize back and forth all integer/float primitives.
/// </summary>
Expand Down

0 comments on commit 60b7333

Please sign in to comment.