示例#1
0
        public void SelectPage(BolaoNet.Business.IBusinessBase entry, string condition, string order, string compareQuery)
        {
            IList <Framework.DataServices.Model.EntityBaseData> result = entry.SelectPage(
                condition, order, BolaoNet.Tests.Dao.Time.PagingPage, BolaoNet.Tests.Dao.Time.PagingPage);

            if (result == null)
            {
                throw new AssertTestException("It was not possible to select the page.");
            }


            if (result.Count > Tests.Dao.Time.PagingTotalRows + 1)
            {
                throw new AssertTestException("There are more rows returned than allowed");
            }


            object objResult = _commonDatabase.ExecuteScalar(
                System.Data.CommandType.Text, compareQuery, false, _currentUser);

            if (result.Count > (int)objResult)
            {
                throw new AssertTestException("There are more rows returned than the specific query.");
            }
        }
示例#2
0
        public void Load(BolaoNet.Business.IBusinessBase entry)
        {
            bool result = entry.Load();

            if (result == false)
            {
                throw new AssertTestException("It was not possible to load the object.");
            }
        }
示例#3
0
        public void Update(BolaoNet.Business.IBusinessBase entry, string compareQuery)
        {
            bool result = entry.Update();

            if (result == false)
            {
                throw new AssertTestException("It was not possible to update the object.");
            }

            object objResult = _commonDatabase.ExecuteScalar(
                System.Data.CommandType.Text, compareQuery, false, _currentUser);


            //if (string.Compare(((Model.Campeonato)entry).Descricao, objResult.ToString()) != 0)
            //    throw new AssertTestException("Incompatible results between database and object.");
        }
示例#4
0
        public void SelectCombo(BolaoNet.Business.IBusinessBase entry, string compareQuery, params object[] fields)
        {
            IList <Framework.DataServices.Model.EntityBaseData> result = entry.SelectCombo(fields);

            if (result == null)
            {
                throw new AssertTestException("It was not possible to load the combo.");
            }

            object objResult = _commonDatabase.ExecuteScalar(
                System.Data.CommandType.Text, compareQuery, false, _currentUser);

            if ((int)objResult != result.Count)
            {
                throw new AssertTestException("The result contains the quantity rows different from oridinal database.");
            }
        }
示例#5
0
        public void Delete(BolaoNet.Business.IBusinessBase entry, string compareQuery)
        {
            bool result = entry.Delete();

            if (result == false)
            {
                throw new AssertTestException("It was not possible to delete the object.");
            }

            object objResult = _commonDatabase.ExecuteScalar(
                System.Data.CommandType.Text, compareQuery, false, _currentUser);

            if ((int)objResult >= 1)
            {
                throw new AssertTestException("The row was not deleted in database.");
            }
        }
示例#6
0
        public void SelectCount(BolaoNet.Business.IBusinessBase entry, string condition, string compareQuery)
        {
            int result = entry.SelectCount(condition);

            if (result < 0)
            {
                throw new AssertTestException("It was not possible to load the count of rows.");
            }


            object objResult = _commonDatabase.ExecuteScalar(
                System.Data.CommandType.Text, compareQuery, false, _currentUser);

            if (result != (int)objResult)
            {
                throw new AssertTestException("There are more rows returned than the specific query.");
            }
        }
示例#7
0
        public void SelectAll(BolaoNet.Business.IBusinessBase entry, string condition, string compareQuery)
        {
            IList <Framework.DataServices.Model.EntityBaseData> result = entry.SelectAll(condition);

            if (result == null)
            {
                throw new AssertTestException("It was not possible to select the items.");
            }


            object objResult = _commonDatabase.ExecuteScalar(
                System.Data.CommandType.Text, compareQuery, false, _currentUser);

            if (result.Count != (int)objResult)
            {
                throw new AssertTestException("There are differences between database and list returned.");
            }
        }