package com.gwesm;
import junit.framework.Assert;
import org.junit.Test;
import com.gwesm.core.Account;
import com.gwesm.core.GWESM;
import com.gwesm.dao.CastorDAO;
import com.gwesm.dao.DAO;
public class TestAccounts {
@Test
public void testSaveGWESM() throws Exception {
final String outputFile = "testsData\\outputs\\SaveGWESM.xml";
DAO dao = new CastorDAO();
// Creation de l'arbre
GWESM gwesm = new GWESM();
Account account1 = new Account("Mon Compte");
gwesm.addAccount(account1);
// Verif création
Assert.assertEquals(1, gwesm.getAccounts().size());
// Sauvegarde
dao.saveData(gwesm, outputFile);
// Chargement
GWESM loadedGwesm = dao.loadData(outputFile);
// Verif persistence
Assert.assertEquals(1, loadedGwesm.getAccounts().size());
}
}