UnitTestTypes.cs 4.2 KB

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