#include "synapseMatrixTest.h"

void SynapseMatrixTest::setUp(){
 // construction du test
    SynM1 = new SynapseMatrix(3,2);
    SynM2 = new SynapseMatrix(4,4);
}

void SynapseMatrixTest::tearDown(){
 // destruction du test
    delete SynM1;
    delete SynM2;
}

void SynapseMatrixTest::testOperatorIndex(){
    SynapseMatrix SynM3(3,5);
    SynM3(0,4) = 2.1;
    CPPUNIT_ASSERT( SynM3(0,4).getWeight()==2.1 );
}

void SynapseMatrixTest::testOperatorAssign(){
    SynapseMatrix SynM4(5,4);
    SynapseMatrix SynM5(2,2);
    SynM4(3,2) = 3.2;
    SynM5 = SynM4;
    CPPUNIT_ASSERT( SynM5(3,2).getWeight()==3.2 );
}

void SynapseMatrixTest::testInit(){
 // verifie les assignations du constructeur de la classe
    CPPUNIT_ASSERT( SynM1->getLineCount()==3 );
    CPPUNIT_ASSERT( SynM2->getLineCount()==4 );
    CPPUNIT_ASSERT( SynM1->getColumnCount()==2 );
    CPPUNIT_ASSERT( SynM2->getColumnCount()==4 );
}

