Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AdaptivePerformanceLoaderHelperUnitTests.cs 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #if NUGET_MOQ_AVAILABLE
  2. using System;
  3. using Moq;
  4. using System.Collections.Generic;
  5. using NUnit.Framework;
  6. using UnityEngine;
  7. using UnityEngine.AdaptivePerformance;
  8. namespace UnityEditor.AdaptivePerformance.Editor.Tests
  9. {
  10. public class AdaptivePerformanceLoaderHelperUnitTests : AdaptivePerformanceLoaderHelper
  11. {
  12. [Test]
  13. public void CreateSubsystemWithNullDescriptorsProvided_ExceptionThrown()
  14. {
  15. try
  16. {
  17. CreateSubsystem<ISubsystemDescriptor, ISubsystem>(null, "something");
  18. Assert.Fail("Meant to throw an Exception of Type 'ArgumentNull': ");
  19. }
  20. catch (ArgumentNullException ex)
  21. {
  22. Assert.AreEqual(0, m_SubsystemInstanceMap.Count);
  23. }
  24. }
  25. [Test]
  26. public void CreateSubsystemWithEmptyDescriptorsProvided_NoExceptionThrown()
  27. {
  28. CreateSubsystem<ISubsystemDescriptor, ISubsystem>(new List<ISubsystemDescriptor>(), "something");
  29. Assert.AreEqual(0, m_SubsystemInstanceMap.Count);
  30. }
  31. [Test]
  32. public void CreateSubsystemWithAtLeastOneDescriptor_NoExceptionThrown()
  33. {
  34. List<ISubsystemDescriptor> sdList = new List<ISubsystemDescriptor>();
  35. sdList.Add(Mock.Of<ISubsystemDescriptor>());
  36. CreateSubsystem<ISubsystemDescriptor, ISubsystem>(sdList, "something");
  37. Assert.AreEqual(0, m_SubsystemInstanceMap.Count);
  38. }
  39. public override bool Initialized { get; }
  40. public override bool Running { get; }
  41. public override ISubsystem GetDefaultSubsystem()
  42. {
  43. return null;
  44. }
  45. public override IAdaptivePerformanceSettings GetSettings()
  46. {
  47. return null;
  48. }
  49. }
  50. }
  51. #endif