Skip to content

Commit

Permalink
add test for fsprojects#82
Browse files Browse the repository at this point in the history
  • Loading branch information
mexx committed Jan 1, 2016
1 parent 2fceb86 commit fd334fb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/FSharp.Configuration.Tests/Lists.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,14 @@ Archive:
ConnectionString: Server=localhost;Database=message_archive;Uid=xmpp;Pwd=password
- Type: mssql
Writeonly: false
ConnectionString: Data Source=server1;Initial Catalog=message_archive;Integrated Security=SSPI;
ConnectionString: Data Source=server1;Initial Catalog=message_archive;Integrated Security=SSPI;

Fix82:
id: "myApp"
constraints:
-
- "attribute"
- "OPERATOR"
- "value"
labels:
environment: "staging"
26 changes: 26 additions & 0 deletions tests/FSharp.Configuration.Tests/YamlProvider.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,32 @@ items:
settings.items.[2].descrip |> should equal "High Heeled \"Ruby\" Slippers"
settings.items.[2].quantity |> should equal 1

[<Test>]
let ``Can load nested lists``() =
let settings = Lists()
settings.LoadText """
Fix82:
id: "myApp"
constraints:
-
- "attribute"
- "OPERATOR"
- "value"
-
- "field"
- "OP"
labels:
environment: "staging"
"""
settings.Fix82.constraints.Count |> should equal 2
settings.Fix82.constraints.[0].Count |> should equal 3
settings.Fix82.constraints.[0].[0] |> should equal "attribute"
settings.Fix82.constraints.[0].[1] |> should equal "OPERATOR"
settings.Fix82.constraints.[0].[2] |> should equal "value"
settings.Fix82.constraints.[1].Count |> should equal 2
settings.Fix82.constraints.[1].[0] |> should equal "field"
settings.Fix82.constraints.[1].[1] |> should equal "OP"

[<Ignore>]
[<Test>]
let ``Check that list defaults are OK``() =
Expand Down

0 comments on commit fd334fb

Please sign in to comment.