Пример #1
0
        public void CustomerAccess_FillCustomerData_TestMethod()
        {
            SqlConnection connection = ConnectionManager.Connection;

            connection.Open();
            CustomerAccess.FillDictionary();
            CustomerAccess.FillCustomerData();
            DataSet dataSet = (DataSet)CustomerAccess.GetData();

            Assert.IsTrue(dataSet.Tables["Customer"].Rows.Count > 0);
        }
Пример #2
0
        public void CustomerAccess_GetCustomersByBirthday_TestMethod(int year, int m, int day)
        {
            SqlConnection connection = ConnectionManager.Connection;

            connection.Open();
            CustomerAccess.FillDictionary();
            CustomerAccess.FillCustomerData();
            CustomerAccess.GetCustomersByBirthOfDay(new DateTime(year, m, day));
            DataSet dataSet = (DataSet)CustomerAccess.GetData();

            Assert.IsTrue(dataSet.Tables["Customer"].Rows.Count > 0);
        }
Пример #3
0
        public void CustomerAccess_GetCustomersByBirthdayBetween_TestMethod()
        {
            SqlConnection connection = ConnectionManager.Connection;

            connection.Open();
            CustomerAccess.FillDictionary();
            CustomerAccess.FillCustomerData();
            CustomerAccess.GetCustomersByBirthdayBetween(new DateTime(1970, 1, 1), new DateTime(2016, 01, 01));
            DataSet dataSet = (DataSet)CustomerAccess.GetData();

            Assert.IsTrue(dataSet.Tables["Customer"].Rows.Count > 0);
        }
Пример #4
0
        public void CustomerAccess_GetCustomersByGlossary_TestMethod(string name, string glossary, int Id)
        {
            SqlConnection connection = ConnectionManager.Connection;

            connection.Open();
            CustomerAccess.FillDictionary();
            CustomerAccess.FillCustomerData();
            CustomerAccess.GetCustomersByGlossary(name, glossary, Id);
            DataSet dataSet = (DataSet)CustomerAccess.GetData();

            Assert.IsTrue(dataSet.Tables["Customer"].Rows.Count > 0);
        }
Пример #5
0
        public void CustomerAccess_GetByAddress_TestMethod(string addr)
        {
            SqlConnection connection = ConnectionManager.Connection;

            connection.Open();

            CustomerAccess.FillDictionary();
            CustomerAccess.FillCustomerData();
            CustomerAccess.GetDataByCriteria("Address", new[] { "Славянск", addr });
            DataSet dataSet = (DataSet)CustomerAccess.GetData();

            Assert.IsTrue(dataSet.Tables["Customer"].Rows.Count > 0);
        }
        public void Query_GlossaryQuery_ExecuteMethod_TestMethod(string nameGlossary, int id)
        {
            SqlConnection connection = ConnectionManager.Connection;

            connection.Open();
            CustomerAccess.FillDictionary();
            CustomerAccess.FillCustomerData();
            DataSet           dataSet  = (DataSet)CustomerAccess.GetData();
            NewCriteria <int> criteria = new NewCriteria <int>("=", nameGlossary, id);
            GlossaryQuery     glossary = new GlossaryQuery();

            glossary.Criterias(criteria);
            dataSet = (DataSet)glossary.Execute();
            Assert.IsTrue(dataSet.Tables["Customer"].Rows.Count > 0);
        }
Пример #7
0
        public void CustomerAccess_GetDataByCriteria_TestMethod(string lastname1, string addr1, string lastName2, string addr2)
        {
            SqlConnection connection = ConnectionManager.Connection;

            connection.Open();

            CustomerAccess.FillDictionary();
            CustomerAccess.FillCustomerData();
            CustomerAccess.GetDataByCriteria("LastName", new[] { lastname1 }, "=");
            CustomerAccess.GetDataByCriteria("Address", new [] { "Славянск", addr1 }, "=");
            CustomerAccess.GetDataByCriteria("LastName", new[] { lastName2, }, "=");
            CustomerAccess.GetDataByCriteria("Address", new[] { "Славянск", addr2 }, "=");
            DataSet dataSet = (DataSet)CustomerAccess.GetData();

            Assert.IsTrue(dataSet.Tables["Customer"].Rows.Count > 0);
        }
Пример #8
0
 public object FillAll()
 {
     CustomerAccess.FillDictionary();
     CustomerAccess.FillCustomerData();
     return(CustomerAccess.GetData());
 }