UnitTestTypes.cs 3.8 KB

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