UnitTestTypes.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using System.Collections.Generic;
  2. using BansheeEngine;
  3. namespace BansheeEditor
  4. {
  5. /// <summary>
  6. /// Helper component used for unit tests.
  7. /// </summary>
  8. public class UT1_Component1 : Component
  9. {
  10. public int a;
  11. public string b;
  12. public UT1_SerzObj complex = new UT1_SerzObj();
  13. public UT1_SerzCls complex2 = new UT1_SerzCls();
  14. public int[] arrA;
  15. public string[] arrB;
  16. public UT1_SerzObj[] arrComplex;
  17. public UT1_SerzCls[] arrComplex2;
  18. public List<int> listA;
  19. public List<string> listB;
  20. public List<UT1_SerzObj> listComplex;
  21. public List<UT1_SerzCls> listComplex2;
  22. public UT1_Component2 otherComponent;
  23. public SceneObject otherSO;
  24. }
  25. /// <summary>
  26. /// Helper component used for unit tests.
  27. /// </summary>
  28. public class UT1_Component2 : Component
  29. {
  30. public int a2;
  31. }
  32. /// <summary>
  33. /// Helper type used for unit tests.
  34. /// </summary>
  35. [SerializeObject]
  36. public class UT1_SerzCls
  37. {
  38. public int someValue2;
  39. public string anotherValue2;
  40. public UT1_SerzCls child;
  41. }
  42. /// <summary>
  43. /// Helper type used for unit tests.
  44. /// </summary>
  45. [SerializeObject]
  46. public struct UT1_SerzObj
  47. {
  48. public UT1_SerzObj(int someValue, string anotherValue)
  49. {
  50. this.someValue = someValue;
  51. this.anotherValue = anotherValue;
  52. }
  53. public int someValue;
  54. public string anotherValue;
  55. }
  56. /// <summary>
  57. /// Helper type used for unit tests.
  58. /// </summary>
  59. [SerializeObject]
  60. public class UT_DiffChildObj
  61. {
  62. public int plain1 = 101;
  63. public string plain2 = "oneoone";
  64. }
  65. /// <summary>
  66. /// Helper type used for unit tests.
  67. /// </summary>
  68. [SerializeObject]
  69. public class UT_DiffObj
  70. {
  71. public int plain1 = 5;
  72. public string plain2 = "six";
  73. public UT_DiffChildObj complex = null;
  74. public UT_DiffChildObj complex2 = new UT_DiffChildObj();
  75. public UT_DiffChildObj complex3 = new UT_DiffChildObj();
  76. public int[] arrPlain1 = { 10, 11, 12 };
  77. public string[] arrPlain2 = { "one", "two", "three" };
  78. public UT_DiffChildObj[] arrComplex = null;
  79. public UT_DiffChildObj[] arrComplex2 = new UT_DiffChildObj[2];
  80. public List<int> listPlain1 = new List<int>();
  81. public List<string> listPlain2 = new List<string>();
  82. public List<UT_DiffChildObj> listComplex = null;
  83. public List<UT_DiffChildObj> listComplex2 = new List<UT_DiffChildObj>();
  84. public Dictionary<int, int> dictPlain1 = new Dictionary<int, int>();
  85. public Dictionary<string, string> dictPlain2 = new Dictionary<string, string>();
  86. public Dictionary<int, UT_DiffChildObj> dictComplex = null;
  87. public Dictionary<int, UT_DiffChildObj> dictComplex2 = new Dictionary<int, UT_DiffChildObj>();
  88. public UT_DiffObj()
  89. {
  90. arrComplex2[0] = new UT_DiffChildObj();
  91. arrComplex2[1] = null;
  92. listPlain1.AddRange(new int[] { 4, 5, 6 });
  93. listPlain2.AddRange(new string[] {"four", "five", "six"});
  94. listComplex2.Add(new UT_DiffChildObj());
  95. listComplex2.Add(new UT_DiffChildObj());
  96. dictPlain1[20] = 20;
  97. dictPlain1[21] = 21;
  98. dictPlain1[22] = 22;
  99. dictPlain2["twenty"] = "twenty";
  100. dictPlain2["twentyone"] = "twentyone";
  101. dictPlain2["twentytwo"] = "twentytwo";
  102. dictComplex2[30] = new UT_DiffChildObj();
  103. dictComplex2[31] = new UT_DiffChildObj();
  104. dictComplex2[32] = new UT_DiffChildObj();
  105. }
  106. }
  107. }