Created
June 14, 2015 11:33
-
-
Save calindotgabriel/66efb408e7d14ccc751a 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", "f2.txt"); | |
std::cout << repo->getProducts().size(); | |
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