mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-15 14:54:09 +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 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]
|
[Test]
|
||||||
public static void TestPrimitives()
|
public static void TestPrimitives()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue