Пример #1
0
        protected void Complete(Object context)
        {
            TestEventArgs e = new TestEventArgs(this.GetType().FullName,
                                                TestState.Finished.ToString(), tstResult.ToString(), "Finished");

            GFXDTestRunner.OnTestEvent(e);

            lock (context)
            {
                GFXDTestRunner.TestCount -= 1;

                if (GFXDTestRunner.TestCount == 0)
                {
                    if (resetEvent != null)
                    {
                        resetEvent.Set();
                    }
                }
            }

            Log(String.Format("Test {0} completed. Result: {1}",
                              this.GetType().FullName, tstResult));

            try
            {
                if ((Connection != null) && (!Connection.IsClosed) &&
                    (Connection.State != ConnectionState.Executing))
                {
                    Connection.Close();
                }
            }
            catch (Exception ex)
            {
                Log(ex);
            }
        }
Пример #2
0
        public static void ShowTablesData(String schemaName)
        {
            DbController dbc = null;

            if (String.IsNullOrEmpty(schemaName))
            {
                dbc = new DbController(DbHelper.OpenNewConnection());
            }
            else
            {
                dbc = new DbController(DbHelper.OpenNewConnection(), schemaName);
            }

            IList <Address> addresses = dbc.GetAddresses();

            foreach (Address addr in addresses)
            {
                GFXDTestRunner.OnTestEvent(new TestEventArgs("Address: " + addr.ToString()));
            }

            IList <Supplier> suppliers = dbc.GetSuppliers();

            foreach (Supplier supp in suppliers)
            {
                GFXDTestRunner.OnTestEvent(new TestEventArgs("Supplier: " + supp.ToString()));
            }

            IList <Category> categories = dbc.GetCategories();

            foreach (Category cat in categories)
            {
                GFXDTestRunner.OnTestEvent(new TestEventArgs("Category: " + cat.ToString()));
            }

            IList <Product> products = dbc.GetProducts();

            foreach (Product prod in products)
            {
                GFXDTestRunner.OnTestEvent(new TestEventArgs("Product: " + prod.ToString()));
            }

            IList <Customer> customers = dbc.GetCustomers();

            foreach (Customer cust in customers)
            {
                GFXDTestRunner.OnTestEvent(new TestEventArgs("Customer: " + cust.ToString()));
            }

            IList <Order> orders = dbc.GetOrders();

            foreach (Order ord in orders)
            {
                GFXDTestRunner.OnTestEvent(new TestEventArgs("Order: " + ord.ToString()));
            }

            IList <OrderDetail> ordDetails = dbc.GetOrderDetails();

            foreach (OrderDetail ordDetail in ordDetails)
            {
                GFXDTestRunner.OnTestEvent(new TestEventArgs("OrderDetail: " + ordDetail.ToString()));
            }
        }