ContentUnitTest.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections.Generic;
  2. using System.Reflection;
  3. using Content.Client.IoC;
  4. using Content.Server.IoC;
  5. using Content.Shared.IoC;
  6. using Robust.Shared.Analyzers;
  7. using Robust.UnitTesting;
  8. using EntryPoint = Content.Server.Entry.EntryPoint;
  9. namespace Content.Tests
  10. {
  11. [Virtual]
  12. public class ContentUnitTest : RobustUnitTest
  13. {
  14. protected override void OverrideIoC()
  15. {
  16. base.OverrideIoC();
  17. SharedContentIoC.Register();
  18. if (Project == UnitTestProject.Server)
  19. {
  20. ServerContentIoC.Register();
  21. }
  22. else if (Project == UnitTestProject.Client)
  23. {
  24. ClientContentIoC.Register();
  25. }
  26. }
  27. protected override Assembly[] GetContentAssemblies()
  28. {
  29. var l = new List<Assembly>
  30. {
  31. typeof(Content.Shared.Entry.EntryPoint).Assembly
  32. };
  33. if (Project == UnitTestProject.Server)
  34. {
  35. l.Add(typeof(EntryPoint).Assembly);
  36. }
  37. else if (Project == UnitTestProject.Client)
  38. {
  39. l.Add(typeof(Content.Client.Entry.EntryPoint).Assembly);
  40. }
  41. l.Add(typeof(ContentUnitTest).Assembly);
  42. return l.ToArray();
  43. }
  44. }
  45. }