mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Extended nullable types sample
This commit is contained in:
parent
d932857f34
commit
7e28bc959e
@ -39,6 +39,20 @@ begin
|
||||
{
|
||||
lNullableInt.Value raises exception if "lNullableInt.IsNull = True"
|
||||
}
|
||||
|
||||
lNullableInt := nil; // set to null
|
||||
Assert(lNullableInt.IsNull);
|
||||
Assert(not lNullableInt.HasValue);
|
||||
lNullableInt := 123;
|
||||
Assert(lNullableInt.HasValue);
|
||||
|
||||
lNullableInt.SetNull; // set to null
|
||||
Assert(lNullableInt.IsNull);
|
||||
Assert(not lNullableInt.HasValue);
|
||||
|
||||
lNullableInt.Clear; // set to null
|
||||
Assert(lNullableInt.IsNull);
|
||||
Assert(not lNullableInt.HasValue);
|
||||
end;
|
||||
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user