mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
More nullable tests
This commit is contained in:
parent
20faf884f5
commit
a183da923d
1 changed files with 27 additions and 0 deletions
|
@ -4,6 +4,33 @@ namespace Tests
|
|||
{
|
||||
class Nullable
|
||||
{
|
||||
class ClassA
|
||||
{
|
||||
public int mA = 100;
|
||||
|
||||
public int Prop
|
||||
{
|
||||
set
|
||||
{
|
||||
mA = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int GetVal()
|
||||
{
|
||||
return 123;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
ClassA ca = scope .();
|
||||
ca?.Prop = ca.GetVal();
|
||||
Test.Assert(ca.mA == 123);
|
||||
ca = null;
|
||||
ca?.Prop = ca.GetVal();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestPrimitives()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue