private static DbTable <T> _Test <T>(Assembly ca, DbTable <T> node, string title, TestingOption option)
            where T : DbRow
        {
            if (Admin.IsTestingEnvironmentOff(ca) || option == TestingOption.Skip)
            {
                return(node);
            }

            // handle reusability - !
            var node2 = node.RootWithBrokenChain ?? node.Root;

            Chainer query;

            if (node2.IsPureSubject())
            {
                query = new SelectChainer((ISemantic)node2, new Column[] { }, false).Top(Admin.TestSelectTopRows);
            }
            else
            {
                query = new SelectChainer((ISemantic)node2, new Column[] { }, false);
            }

            var connectable = Reader.GetConnectable(ca, query);

            using (var form = new TestingForm(connectable, option, title))
            {
                form.ShowDialog();
            }

            node2.Recover();

            return(node);
        }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     using (TestingForm tests = new TestingForm())
     {
         tests.ShowDialog();
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Opens the testing environment window. When closed the execution proceeds. The testing does not affect the data state of the execution.
        /// </summary>
        /// <param name="view">A view object.</param>
        /// <param name="title">A title that will appear in the window.</param>
        /// <param name="option">An option that specifies whether the testing environment window should open, should open and execute, or should be skipped.</param>
        public static View Test(this View view, string title, TestingOption option = TestingOption.OpenAndExecute)
        {
            return(PublicInvoker.Call <View>(Assembly.GetCallingAssembly(), (ca) =>
            {
                var connectable = Reader.GetConnectable(ca, (Chainer)view);
                if (!Admin.IsTestingEnvironmentOff(ca) && option != TestingOption.Skip)
                {
                    using (var form = new TestingForm(connectable, option, title))
                    {
                        form.ShowDialog();
                    }
                }

                return view;
            }));
        }
Esempio n. 4
0
        /// <summary>
        /// Opens the testing environment window. When closed the execution proceeds. The testing does not affect the data state of the execution.
        /// </summary>
        /// <param name="prev">A predecessor object.</param>
        /// <param name="option">An option that specifies whether the testing environment window should open, should open and execute, or should be skipped.</param>
        public static Connectable Test(this IGo prev, TestingOption option = TestingOption.OpenAndExecute)
        {
            return(PublicInvoker.Call <Connectable>(Assembly.GetCallingAssembly(), (ca) =>
            {
                var connectable = Reader.GetConnectable(ca, (Chainer)prev);
                if (!Admin.IsTestingEnvironmentOff(ca) && option != TestingOption.Skip)
                {
                    using (var form = new TestingForm(connectable, option, null))
                    {
                        form.ShowDialog();
                    }
                }

                return connectable;
            }));
        }