コード例 #1
0
        /// <summary>
        /// export the result of the run to TestLink. As a sideeffect, this may create a test case
        /// </summary>
        /// <param name="data"></param>
        public void ReportResult(Gallio.Runner.Reports.Schema.TestStepRun data)
        {
            try
            {
                TestLinkFixtureAttribute tlfa = getFixture(data.Step.FullName);
                if (tlfa == null)
                {
                    Debug.WriteLine(string.Format("Failed to find testlinkfixture of name {0}", data.Step.FullName));
                    Console.Error.WriteLine("Failed to find testlinkfixture of name {0}", data.Step.FullName);
                    adaptor.ConnectionData = null;
                    return;
                }
                adaptor.ConnectionData = tlfa;
                //Debug.WriteLine(string.Format("new Testlink({0}, {1}", tlfa.DevKey, tlfa.Url));


                string TestName = data.Step.Name;
                // Console.WriteLine(TestName);
                if (adaptor.ConnectionValid)
                {
                    int tcid = adaptor.GetTestCaseId(TestName);
                    if (tcid > 0)
                    {
                        //Console.Write("1");
                        recordResult(data, tcid);
                    }
                    else
                    {
                        Console.WriteLine("Could not find test case named '{0}'", TestName);
                    }
                }
                else
                {
                    Console.WriteLine(" -- Failed to export {0} --", TestName);
                }
            }
            catch (TestLinkException tlex)
            {
                Debug.WriteLine(tlex.Message);
                Console.WriteLine(tlex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception occurred in TestLinkAddOn");
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
        }
コード例 #2
0
        //      private void recordResult(TestStepRun data, TestLinkFixtureAttribute tlfa, int testPlanId, int TCaseId)
        private void recordResult(Gallio.Runner.Reports.Schema.TestStepRun data, int TCaseId)
        {
            //Console.Write("2");
            TestCaseResultStatus status = TestCaseResultStatus.Blocked;//= (data.Result.Outcome.Status == TestStatus.Passed)

            //? TestCaseResultStatus.Pass : TestCaseResultStatus.Fail;

            switch (data.Result.Outcome.Status)
            {
            case TestStatus.Passed: status = TestCaseResultStatus.Pass; break;

            case TestStatus.Failed: status = TestCaseResultStatus.Fail; break;

            case TestStatus.Skipped: status = TestCaseResultStatus.Blocked; break;

            case TestStatus.Inconclusive: status = TestCaseResultStatus.Blocked; break;
            }

            string notes = data.TestLog.ToString();

            //Debug.WriteLine(
            //    string.Format("ReportTCResult(TCName=\"{0}\", TestPlan=\"{1}\", Status=\"{2}\", Notes=\"{3}\"",
            //    data.Step.Name,
            //    tlfa.TestPlan,
            //    (data.Result.Outcome.Status == TestStatus.Passed) ? "p" : "f",
            //   notes));

            //Console.Write("3");
            GeneralResult reportResult = adaptor.RecordTheResult(TCaseId, status, notes);//proxy.ReportTCResult(TCaseId, testPlanId, status, notes);

            //Console.Write("4");
            if (reportResult.status == true)
            {
                Console.WriteLine("Recorded test run result for {0} as {1}",
                                  data.Step.Name, data.Result.Outcome);
            }
            else
            {
                Console.Error.WriteLine(string.Format("recorded test result. status={0}, message ='{0}'",
                                                      reportResult.status, reportResult.message));
            }
        }
コード例 #3
0
 public void Setup()
 {
     _run = GallioRunner.RunAllSpecificationsFor <failing_specification_assertions>();
 }
コード例 #4
0
 public void Setup()
 {
     _run = GallioRunner.RunAllSpecificationsFor <at_any_given_moment>();
 }
コード例 #5
0
 public void Setup()
 {
     _run = GallioRunner.RunAllSpecificationsFor <Example.when_a_customer_first_views_the_account_summary_page>();
 }
コード例 #6
0
 public void Setup()
 {
   _run = GallioRunner.RunAllSpecificationsFor<Example.when_transferring_an_amount_larger_than_the_balance_of_the_from_account>();
 }
コード例 #7
0
 public void Setup()
 {
   _run = GallioRunner.RunAllSpecificationsFor<Example.when_transferring_between_two_accounts>();
 }
コード例 #8
0
 public void Setup()
 {
   _run = GallioRunner.RunAllSpecificationsFor<failing_specification_assertions>();
 }
コード例 #9
0
 public void Setup()
 {
   _run = GallioRunner.RunAllSpecificationsFor<at_any_given_moment>();
 }
コード例 #10
0
 public void Setup()
 {
     _run = GallioRunner.RunAllSpecificationsFor <Example.when_transferring_an_amount_larger_than_the_balance_of_the_from_account>();
 }
コード例 #11
0
 public void Setup()
 {
     _run = GallioRunner.RunAllSpecificationsFor <Example.when_transferring_between_two_accounts>();
 }
コード例 #12
0
 public void Setup()
 {      
   _run = GallioRunner.RunAllSpecificationsFor<Example.when_a_customer_first_views_the_account_summary_page>();
 }