Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsca committed Oct 10, 2024
1 parent 29af800 commit 2ad98ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@ public class BaseMarket extends BaseAll {

// attributes that can be filtered during comparisons of assertions
private static final String[] FILTERED_ATTRS = {"password", "dateCreated","number"};

// empty cart of an user
public static String queryCartByUser = "tds CartDTO where user='[email protected]'";
// carts with items (products added) of an user, products must be available
public static String queryCartByUserProductQuantity = "tds CartDTO,CartItemDTORes,ProductDTORes where CartDTO.user='[email protected]' and CartItemDTORes.productId=1 and CartItemDTORes.quantity=5 and ProductDTORes.available=1";
// order of an user
public static String queryOrderByUser = "tds OrderDTO where userAccount='[email protected]' ";
// products by age
public static String queryProductByAge = "tds ProductDTORes where age=10";
// users by name
public static String queryUserByName = "tds UserDTORes where name='Pepe'";
// user by email
public static String queryUserByEmail = "tds UserDTORes where email ='[email protected]'";

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ protected boolean isLiveBackend() {

@Test
public void testDictUserDTOResByName() {
// users
String query = queryUserByName;
IAttrGen dict=getDictionaryAttrGen();
DataLoader dg = getLiveDataLoader().setAttrGen(dict);
Expand All @@ -30,7 +29,6 @@ public void testDictUserDTOResByName() {

@Test
public void testDictCartDTOByUser() {
// empty carts
String query = queryCartByUser;
IAttrGen dict=getDictionaryAttrGen();
DataLoader dg = getLiveDataLoader().setAttrGen(dict);
Expand All @@ -40,8 +38,6 @@ public void testDictCartDTOByUser() {

@Test
public void testDictCartDTOByUserProductQuantity() {
// carts and items
// products must be available
String query = queryCartByUserProductQuantity;
IAttrGen dict=getDictionaryAttrGen();
DataLoader dg = getLiveDataLoader().setAttrGen(dict);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testProductsByDistilleryNotAvailable() {

@Test
public void testProductsByDistilleryPrice() {
// available products of a distillery, price between two values
// products of a distillery, price between two values
String query = "tds ProductDTOReq where distillery ='Ardbeg' and price < 100 and price > 5";
IAttrGen dict=getDictionaryAttrGen();
DataLoader dg = getLiveDataLoader().setAttrGen(dict);
Expand All @@ -59,18 +59,17 @@ public void testProductsByDistilleryPrice() {

@Test
public void testProductsByDistilleryPriceAge() {
// available products of a distillery and an age, price between two values
// products of a distillery and an age, price between two values
String query = "tds ProductDTOReq where distillery ='Ardbeg' and price < 100 and price > 5 and age = 12";
IAttrGen dict=getDictionaryAttrGen();
DataLoader dg = getLiveDataLoader().setAttrGen(dict);
generateAndLoad(dg, query, dict);
assertData("func-ProductsByDistilleryPriceAge.txt", dg);
}



@Test
public void testDistilleryByTitle() {
// distillery
// distillery by title
String query = "tds DistilleryDTOReq where title ='Ardbeg'";
IAttrGen dict=getDictionaryAttrGen();
DataLoader dg = getLiveDataLoader().setAttrGen(dict);
Expand All @@ -90,7 +89,7 @@ public void testDistilleryByRegion() {

@Test
public void testRegionByName() {
// region
// region by name
String query = "tds RegionDTOReq where name ='Campbeltown'";
IAttrGen dict=getDictionaryAttrGen();
DataLoader dg = getLiveDataLoader().setAttrGen(dict);
Expand Down

0 comments on commit 2ad98ac

Please sign in to comment.