#include "domain_tests.h"
#include "../domain/domain.h"
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>

void domain_tests(void){
    printf("Running domain tests\n");
    char *name = (char *)malloc(20);
    char *supplier = (char *)malloc(20);
    strcpy(name, "name");
    strcpy(supplier, "supplier");
    Material* material = _Material_Constructor(name,supplier,10,1,2,2005);
    assert(strcmp(_Material_GetName(material), "name") == 0);
    assert(strcmp(_Material_GetSupplier(material), "supplier") == 0);
    assert(_Material_GetQuantity(material) == 10);
    assert(_Material_GetDate(material).tm_mday == 1);
    assert(_Material_GetDate(material).tm_mon == 1);
    assert(_Material_GetDate(material).tm_year == 2005);
    _Material_Destructor(material);
}