Ejemplo n.º 1
0
 private protected TestAssembly(Assembly assembly)
 {
     _assembly   = assembly;
     _children   = new TestUnitCollection(this);
     _options    = TestAssemblyOptions.ForAssembly(assembly);
     Description = FindDescription(assembly);
 }
Ejemplo n.º 2
0
 internal static void AddTestMethods(Type testType, TestUnitCollection addTo)
 {
     foreach (var m in testType.GetRuntimeMethods())
     {
         try {
             var myCase = CreateTest(m);
             if (myCase != null)
             {
                 addTo.Add(myCase);
             }
         } catch (Exception ex) {
             addTo.Add(SkippedInitFailure.CreateTestUnitFactoryProblem(m, ex));
         }
     }
     foreach (var p in testType.GetRuntimeProperties())
     {
         try {
             var myCase = CreateTest(p);
             if (myCase != null)
             {
                 addTo.Add(myCase);
             }
         } catch (Exception ex) {
             addTo.Add(SkippedInitFailure.CreateTestUnitFactoryProblem(p.GetMethod, ex));
         }
     }
 }
Ejemplo n.º 3
0
 public BespokeTheory(ITestDataProvider provider, TestName baseName, Func <TestExecutionContext, object> func, TestOptions options) : base(func.Method)
 {
     _children          = new TestUnitCollection(this);
     _func              = func;
     _testDataProviders = TestDataProviderCollection.Create(provider);
     _baseTestName      = baseName;
     _options           = options;
     Timeout            = options.Timeout;
     PassExplicitly     = options.PassExplicitly;
     Reason             = options.Reason;
     Tags.Add(TestTag.Dynamic);
 }
Ejemplo n.º 4
0
 private protected TestNamespace(string ns, IEnumerable <TestUnit> typeUnits)
 {
     _namespace = ns;
     _children  = new TestUnitCollection(this);
     foreach (var unit in typeUnits)
     {
         if (unit == null)
         {
             continue;
         }
         Children.Add(unit);
     }
 }
Ejemplo n.º 5
0
        private protected TestClassInfo(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (!type.IsClass)
            {
                throw new ArgumentException();
            }
            _type     = type;
            _children = new TestUnitCollection(this);

            var attr = type.GetCustomAttribute <DescriptionAttribute>();

            if (attr != null)
            {
                Description = attr.Description;
            }
        }
Ejemplo n.º 6
0
 public ReflectedTheory(MethodInfo method) : base(method)
 {
     _children = new TestUnitCollection(this);
 }
Ejemplo n.º 7
0
 public TestRun()
 {
     _children = new TestUnitCollection(this);
 }