Esempio n. 1
0
 internal TestCaseResult(TestCaseInfo testCase, TestStatus status = TestStatus.NotRun)
 {
     _status   = status;
     Reason    = testCase.Reason;
     _testName = testCase.TestName;
     _type     = testCase.Type;
 }
Esempio n. 2
0
        internal static TestName Create(TestCaseInfo caze)
        {
            string assembly = null;
            string ns       = null;
            string clazz    = null;
            string binding  = null;
            IEnumerable <string> arguments = Array.Empty <string>();

            if (caze.TestMethodArguments != null)
            {
                arguments = caze.TestMethodArguments.Select(
                    TextUtility.ConvertToString
                    );
            }

            foreach (var a in caze.Ancestors())
            {
                switch (a)
                {
                case TestSubjectClassBinding m:
                    binding = TextUtility.ConvertToSimpleTypeName(m.TestSubject.GetType(), qualified: true);
                    break;

                case TestAssembly m:
                    assembly = m.Assembly.FullName;
                    break;

                case TestNamespace m:
                    ns = m.Namespace;
                    break;

                case TestClassInfo m:
                    clazz = m.TestClass.Name;
                    break;
                }
            }
            return(new TestName(
                       assembly, ns, clazz, binding, caze.MethodName, caze.Position, caze.TestData.Name, arguments
                       ));
        }
 public NodeExecutionContext(CaseNode node, TestContext parent, TestCaseInfo self, object testObject)
     : base(node, parent, self, testObject)
 {
 }
 public CaseNode(TestCaseInfo unit, CompositeNode parent) : base(unit, new DefaultTestContext(parent.InitContext, unit))
 {
     _parent    = parent;
     _execution = new NodeExecutionContext(this, InitContext, Case, Case.CreateTestObject());
 }