Example #1
0
        public void GetListOperationNoErrorWithNegativeInputTest(string db, string provider)
        {
            CreateOnixDbContext(db, provider);
            ArrayList arr = CreateMultipleItems <CompanyProfile>(db, provider, param, 100, "TESTING");

            QueryRequestParam qrp = new QueryRequestParam();

            qrp.ByChunk  = true;
            qrp.PageSize = 9000;

            qrp.AddFilter("Code", "RUNKNOWN_OPERATOR", "N0");
            qrp.AddFilter("UnknownField", "CONTAIN", "ABC");

            qrp.AddOrderBy("UnknownField", "DESC");
            qrp.AddOrderBy("Code", "DESC");
            qrp.AddOrderBy("Name", "DESC");

            try
            {
                QueryResponseParam response = GetListOperationWithParameter <CompanyProfile>(db, provider, param, qrp);
            }
            catch
            {
                Assert.Fail("Exception should not thrown here!!!");
            }
        }
Example #2
0
        public void GetListOperationAllItemsTest(string db, string provider, int count)
        {
            CreateOnixDbContext(db, provider);
            ArrayList arr = CreateMultipleItems <CompanyProfile>(db, provider, param, count, "TESTING");

            QueryRequestParam  qrp      = new QueryRequestParam();
            QueryResponseParam response = GetListOperationWithParameter <CompanyProfile>(db, provider, param, qrp);

            Assert.AreEqual(count, response.Results.Count, "Item count should return as expected!!!");
        }
        public string ExecuteGetListOperation(string oprName, Hashtable args)
        {
            var opr = (GetListOperation)FactoryBusinessOperation.CreateBusinessOperationObject(oprName);

            string jsonFile = args["if"].ToString();
            string content  = File.ReadAllText(jsonFile);

            var qrp = (QueryRequestParam)JsonConvert.DeserializeObject <QueryRequestParam>(content);

            QueryResponseParam response = opr.Apply(qrp);

            string json = JsonConvert.SerializeObject(response, Formatting.Indented);

            return(json);
        }
Example #4
0
        public void GetListOperationWithParameter(string db, string provider)
        {
            CreateOnixDbContext(db, provider);

            QueryRequestParam qrp = new QueryRequestParam();

            qrp.AddFilter("Code", "EQUAL", "N0");
            qrp.AddFilter("Name", "CONTAIN", "ABC");
            qrp.AddFilter("CompanyProfileId", "=", "1000");
            qrp.AddFilter("CompanyProfileId", "IS_NULL", "N");
            qrp.AddFilter("Key", "IS_NULL", "Y");

            qrp.AddOrderBy("Type", "DESC");
            qrp.AddOrderBy("Code", "ASC");
            QueryResponseParam response = GetListOperationWithParameter <CompanyProfile>(db, provider, param, qrp);

            //Assert.AreEqual(true, checkOk, "Unexpected return value from GetCompanyProfileList()!!!");
        }