Tests: Update Properties tests to include indexers

This commit is contained in:
Katy Coe
2019-11-09 23:59:41 +01:00
parent 6cff0f3803
commit 5bee7665e9
4 changed files with 36 additions and 8 deletions

View File

@@ -8,9 +8,14 @@ internal class Test // TypeDefIndex: 1811
// Properties
private int prop1 { get; set; } // 0x00000001800ECD10 0x0000000180143AD0
protected int prop2 { get; private set; } // 0x0000000180156360 0x00000001803E0E90
protected int prop2 { get; private set; } // 0x0000000180156360 0x00000001803E0F20
protected int prop3 { private get; set; } // 0x00000001800ED060 0x000000018019DD90
public static int prop4 { private get; set; } // 0x00000001803E0E50 0x00000001803E0EA0
public static int prop4 { private get; set; } // 0x00000001803E0EE0 0x00000001803E0F30
public string this[int i] { get; } // 0x00000001803E0E80
public string this[double d] { get; } // 0x00000001803E0E50
public string this[long l] { set; } // 0x00000001800EA7B0
public string this[] { get; set; } // 0x00000001803E0EB0 0x00000001800EA7B0
public bool this[int i, int j] { get; } // 0x000000018010E420
// Constructors
public Test(); // 0x00000001800E2000

View File

@@ -10,7 +10,12 @@ internal class Test // TypeDefIndex: 1811
private int prop1 { get; set; } // 0x100BF0C0 0x100EB270
protected int prop2 { get; private set; } // 0x100C5B30 0x100C5B50
protected int prop3 { private get; set; } // 0x100BFC20 0x100C5B40
public static int prop4 { private get; set; } // 0x1034DA60 0x1034DA90
public static int prop4 { private get; set; } // 0x1034DAF0 0x1034DB20
public string this[int i] { get; } // 0x1034DA90
public string this[double d] { get; } // 0x1034DA60
public string this[long l] { set; } // 0x100C5530
public string this[] { get; set; } // 0x1034DAC0 0x100C5530
public bool this[int i, int j] { get; } // 0x100E5880
// Constructors
public Test(); // 0x100BF000

View File

@@ -7,13 +7,18 @@ internal class Test // TypeDefIndex: 1811
// Fields
// Properties
private int prop1 { get; set; } // 0x00561178 0x00561180
protected int prop2 { get; private set; } // 0x00561188 0x00561190
protected int prop3 { private get; set; } // 0x00561198 0x005611A0
public static int prop4 { private get; set; } // 0x005611A8 0x0056120C
private int prop1 { get; set; } // 0x00561230 0x00561238
protected int prop2 { get; private set; } // 0x00561240 0x00561248
protected int prop3 { private get; set; } // 0x00561250 0x00561258
public static int prop4 { private get; set; } // 0x00561260 0x005612C4
public string this[int i] { get; } // 0x00561328
public string this[double d] { get; } // 0x00561384
public string this[long l] { set; } // 0x005613DC
public string this[] { get; set; } // 0x005613E0 0x0056143C
public bool this[int i, int j] { get; } // 0x00561440
// Constructors
public Test(); // 0x00561270
public Test(); // 0x00561448
}

View File

@@ -12,5 +12,18 @@ namespace Il2CppTests.TestSources
protected int prop2 { get; private set; }
protected int prop3 { private get; set; }
public static int prop4 { private get; set; }
// Read-only ndexers
public string this[int i] => "foo";
public string this[double d] => "bar";
// Write-only indexer
public string this[long l] { set {} }
// Read/write indexer
public string this[float f] { get => "baz"; set {} }
// Multi-dimensional indexer
public bool this[int i, int j] => true;
}
}