Skip to content

Instantly share code, notes, and snippets.

@calindotgabriel
Created June 14, 2015 11:33
Show Gist options
  • Save calindotgabriel/66efb408e7d14ccc751a to your computer and use it in GitHub Desktop.
Save calindotgabriel/66efb408e7d14ccc751a to your computer and use it in GitHub Desktop.
#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