public void ShouldFindNullInNullableString() { Regular regular = new Regular { Value = null }; PropertyInfo info = typeof(Regular).GetProperty("Value"); ReflectorProperty <Regular, string> property = new ReflectorProperty <Regular, string>(info); Assert.That(property.IsNull(regular), Is.True); }
public void ShouldFindNullInNullablePrimitive() { Nullable nullable = new Nullable { Value = null }; PropertyInfo info = typeof(Nullable).GetProperty("Value"); ReflectorProperty <Nullable, long?> property = new ReflectorProperty <Nullable, long?>(info); Assert.That(property.IsNull(nullable), Is.True); }
public int Transfer(T source, Addressable destination, long index) { if (nullable.IsNull(source)) { destination.Set(index, 0); return(1); } destination.Set(index, 1); return(inner.Transfer(source, destination, index + 1) + 1); }