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 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); }
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); }
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); }