Created
June 14, 2015 12:54
-
-
Save calindotgabriel/10f45f0dbf969f07a6ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mainwindow.h" | |
#include <QApplication> | |
#include <assert.h> | |
#include <string> | |
#include <iostream> | |
#include "product.h" | |
#include "productrepo.h" | |
void testEntity() { | |
Product product = Product(1, std::string("patrunjel"), 7.0); | |
assert(1 == product.getId()); | |
Product* product2 = new Product(2, std::string("kushkush"), 20.0); | |
assert("kushkush" == product2->getName()); | |
} | |
void testRepo() { | |
ProductRepo* repo = new ProductRepo("/home/motan/work/cpp/examen-product/f1.txt", "/home/motan/work/cpp/examen-product/f2.txt"); | |
std::cout << "Repo has: " << repo->getProducts().size() << " products \n"; | |
assert(repo->getProducts().size() != 0); | |
} | |
int main(int argc, char *argv[]) | |
{ | |
/*QApplication a(argc, argv); | |
MainWindow w; | |
w.show(); | |
return a.exec();*/ | |
testEntity(); | |
testRepo(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment