import java.io.*;

public class Appli {
  
  public static void main(String argv[]) {
    Lot boiteCrayons = null;
    Commande commande = new Commande("Michel Buffa");
    Commande commande1 = new Commande("Michel Buffa");
    Article article_cherche;

    Stylo s = new Stylo("stylo à bille", "bl-01", 1.50, "bleu");
    Stylo s1 = (Stylo) s.testeReflexivite();
    System.out.println("\ns1 = " + s1 + "\n");
    System.out.println(s1.identifieToi());



    System.out.println("-- Premier test : ajout d'article sur commande nulle --\n");

    commande.addLigne(new Stylo("stylo à bille", "bl-01", 1.50, "bleu"), 3);
    commande.addLigne(new Ramette("papier imprimante", "pp-prn",30.70, 80), 5);
    commande.decrisToi();
    System.out.println("-- Prix de la commande  --\n");
    
    commande.getPrix();

    System.out.println("-- Second test : ecriture et lecture de la commande --\n");
    try {
      commande.write("commande.dat");
      
      commande1.read("commande.dat");
      commande1.decrisToi();
      commande1.getPrix();
    } catch(IOException e) {
      e.printStackTrace();
    }
  }
}
