SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
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.

24 lines
730 B

4 years ago
  1. using System;
  2. namespace UnityEngine.TestRunner
  3. {
  4. [AttributeUsage(AttributeTargets.Assembly)]
  5. public class TestRunCallbackAttribute : Attribute
  6. {
  7. private Type m_Type;
  8. public TestRunCallbackAttribute(Type type)
  9. {
  10. var interfaceType = typeof(ITestRunCallback);
  11. if (!interfaceType.IsAssignableFrom(type))
  12. {
  13. throw new ArgumentException(string.Format("Type provided to {0} does not implement {1}", this.GetType().Name, interfaceType.Name));
  14. }
  15. m_Type = type;
  16. }
  17. internal ITestRunCallback ConstructCallback()
  18. {
  19. return Activator.CreateInstance(m_Type) as ITestRunCallback;
  20. }
  21. }
  22. }