UnitTestTypes.cs 3.8 KB

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