public void TestIntValues()
 {
     i = 10;
     Assert.That(i.IsSet, Is.True);
     Assert.That(i.HasValue, Is.True);
     Assert.That(i.Value, Is.EqualTo(10));
 }
 public void TestNullValue()
 {
     i = null;
     Assert.That(i.IsSet, Is.True);
     Assert.That(i.HasValue, Is.False);
     Assert.Throws <InvalidOperationException>(() => { var a = i.Value; });
 }
 public void ResetValue()
 {
     i = default(Settable <int>);
 }
 public void TestInequality(Settable <int> a, Settable <int> b, bool expected)
 {
     Assert.That(a != b, Is.EqualTo(!expected));
 }
        public void TestUndefinedSerialization(Settable <int> a, Settable <int> b, String expectedJson)
        {
            var json = JsonConvert.SerializeObject(new { A = a, B = b }, settings);

            Assert.That(json, Is.EqualTo(expectedJson));
        }