1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Added some new tests

This commit is contained in:
Brian Fiete 2019-11-29 09:22:18 -08:00
parent 64f117b89f
commit a3f1a33c39
5 changed files with 58 additions and 6 deletions

View file

@ -80,20 +80,21 @@ namespace Tests
class ClassB
{
[AttrA(11, 22, "StrA", "StrB")]
int mA;
public int mA = 1;
[AttrB(44, 55)]
int mB;
int mC;
public int mB = 2;
public int mC = 3;
}
[Reflect(.Type)]
class ClassC
{
[AttrA(11, 22, "StrA", "StrC")]
int mA;
public int mA = 1;
[AttrB(44, 55)]
int mB;
int mC;
public int mB = 2;
public int mC = 3;
public float mD = 4;
}
[Test]
@ -158,6 +159,16 @@ namespace Tests
fieldIdx++;
}
let fieldInfo = cb.GetType().GetField("mC").Value;
int cVal = 0;
fieldInfo.GetValue(cb, out cVal);
fieldInfo.SetValue(cb, cVal + 1000);
Test.Assert(cb.mC == 1003);
Variant variantVal = Variant.Create(123);
fieldInfo.SetValue(cb, variantVal);
Test.Assert(cb.mC == 123);
}
}
}