Beispiel #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);
        }
Beispiel #2
0
        public void UpdateQueryRecord()
        {
            QueryTable table = QueryTable.Instance(new QueryDataAccess());

            NonQueryResultModel expectedResult = new NonQueryResultModel()
            {
                Success = true
            };

            NonQueryResultModel result = table.UpdateRecord(new UpdateQueryModel()
            {
                CustomerUUID = "CustUUID01"
            });

            Assert.AreEqual(expectedResult.Success, result.Success);
        }
Beispiel #3
0
        public void DeleteQueryRecordNonExistent()
        {
            QueryTable table = QueryTable.Instance(new QueryDataAccess());

            NonQueryResultModel expectedResult = new NonQueryResultModel()
            {
                Success = false
            };

            NonQueryResultModel result = table.DeleteRecord(new DeleteQueryModel()
            {
                CustomerUUID = "NonExistentID"
            });

            Assert.AreEqual(expectedResult.Success, result.Success);
        }
Beispiel #4
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);
        }