Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issue #24. KeyOptions constructor error

  • Loading branch information...
commit 024043ad1fd7421588688c8e3dd3ae4a986cc5c1 1 parent 077db19
@soitgoes authored
View
15 LoveSeat.IntegrationTest/NewtonSoftTests.cs
@@ -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()
@@ -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();
+ }
}
}
View
11 LoveSeat/Support/KeyOptions.cs
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.