private protected TestAssembly(Assembly assembly) { _assembly = assembly; _children = new TestUnitCollection(this); _options = TestAssemblyOptions.ForAssembly(assembly); Description = FindDescription(assembly); }
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)); } } }
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); }
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); } }
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; } }
public ReflectedTheory(MethodInfo method) : base(method) { _children = new TestUnitCollection(this); }
public TestRun() { _children = new TestUnitCollection(this); }