Skip to content

Commit

Permalink
Fix issue #24. KeyOptions constructor error
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Murphy committed Jan 18, 2012
1 parent 077db19 commit 024043a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
15 changes: 15 additions & 0 deletions LoveSeat.IntegrationTest/NewtonSoftTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public void KeyOptions_Should_Produce_Squirley_Brackets_for_CouchValueMax()
var result = arry.ToString();
Assert.AreEqual("[{},1]", result);
}
[Test]
public void KeyOptions_Should_Produce_Squirley_Brackets_for_CouchValueMax2()
{
var arry = new KeyOptions(CouchValue.MaxValue, 1);
var result = arry.ToString();
Assert.AreEqual("[{},1]", result);
}


[Test]
public void KeyOptions_Should_Produce_IsoTime()
Expand All @@ -56,5 +64,12 @@ public void KeyOptions_Should_Produce_IsoTime()
Assert.AreEqual("[null,%222011-01-01T00%3a00%3a00%22]", result);

}

[Test]
public void KeyOptions_Constructor_Fails()
{
var arry = new KeyOptions(CouchValue.MinValue);
var result = arry.ToString();
}
}
}
11 changes: 7 additions & 4 deletions LoveSeat/Support/KeyOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ namespace LoveSeat
{
public class KeyOptions : IKeyOptions
{
private JArray objects;
private JArray objects = new JArray();

public KeyOptions(params object[] objects)
{
this.objects = new JArray(objects);
public KeyOptions(params object[] objects)
{
foreach (var obj in objects)
{
this.Add(obj);
}
}

public KeyOptions(JArray jArray)
Expand Down

0 comments on commit 024043a

Please sign in to comment.