Exemple #1
0
        public void SelectQueryRecord()
        {
            QueryTable table = QueryTable.Instance(new QueryDataAccess());

            QueryResultModel expectedResult = new QueryResultModel()
            {
                QueryID      = 2,
                CustomerUUID = "CustUUID02",
                Frequency    = "Freq02",
                PriceLimit   = "PriceLimit02",
                Category     = "Cat02",
                CategoryID   = "CatID02"
            };

            QueryResultModel result = table.SelectRecord(new SelectQueryModel()
            {
                CustomerUUID = "CustUUID02"
            });

            Assert.AreEqual(expectedResult.QueryID, result.QueryID);
            Assert.AreEqual(expectedResult.CustomerUUID, result.CustomerUUID);
            Assert.AreEqual(expectedResult.Frequency, result.Frequency);
            Assert.AreEqual(expectedResult.PriceLimit, result.PriceLimit);
            Assert.AreEqual(expectedResult.Category, result.Category);
            Assert.AreEqual(expectedResult.CategoryID, result.CategoryID);
        }
        public ActionResult BrowseApiFindViableItems(EbayBrowseAPIModel data)
        {
            SelectCustomerModel customerData = new SelectCustomerModel()
            {
                Email = data.email
            };
            CustomerResultModel customerResult = customerTable.SelectRecord(customerData);

            if (customerResult.CustomerUUID == null)
            {
                return(Json(new { result = "Fail", reason = "Invalid Customer" }));
            }

            QueryResultModel queryPref = queryTable.SelectRecord(new SelectQueryModel()
            {
                CustomerUUID = customerResult.CustomerUUID
            });

            return(Json(BrowseAPI.ItemSummarySearch(queryPref.CategoryID, queryPref.PriceLimit)));
        }
Exemple #3
0
        public void SelectQueryRecordNonExistent()
        {
            QueryTable table = QueryTable.Instance(new QueryDataAccess());

            QueryResultModel expectedResult = new QueryResultModel();

            QueryResultModel result = table.SelectRecord(new SelectQueryModel()
            {
                CustomerUUID = "NonExistentID"
            });

            Assert.AreEqual(expectedResult.QueryID, result.QueryID);
            Assert.AreEqual(expectedResult.CustomerUUID, result.CustomerUUID);
            Assert.AreEqual(expectedResult.Frequency, result.Frequency);
            Assert.AreEqual(expectedResult.PriceLimit, result.PriceLimit);
            Assert.AreEqual(expectedResult.Category, result.Category);
            Assert.AreEqual(expectedResult.CategoryID, result.CategoryID);
        }
        public ActionResult GetSettings(QueryGetSettingsModel data)
        {
            SelectCustomerModel customerData = new SelectCustomerModel()
            {
                Email = data.email
            };
            CustomerResultModel customerResult = customerTable.SelectRecord(customerData);

            if (customerResult.CustomerUUID == null)
            {
                return(Json(new { result = "Fail", reason = "Invalid Customer" }));
            }

            QueryResultModel queryData = queryTable.SelectRecord(new SelectQueryModel()
            {
                CustomerUUID = customerResult.CustomerUUID
            });

            return(Json(new { result = queryData }));
        }