Example #1
0
void test_dcnet_ejemplo() {
	Conj<Interfaz> ConjuntoIc1;
	Conj<Interfaz> ConjuntoIc2;
	Conj<Interfaz> ConjuntoIc3;
	
	ConjuntoIc1.Agregar(1);
	ConjuntoIc1.Agregar(2);
	ConjuntoIc1.Agregar(3);
	
	ConjuntoIc2.Agregar(1);
	ConjuntoIc2.Agregar(2);
	ConjuntoIc2.Agregar(3);
	
	ConjuntoIc3.Agregar(1);
	ConjuntoIc3.Agregar(2);
	
	Computadora c1 = "dc.uba.ar";
	Computadora c2 = "uba.ar";
	Computadora c3 = "dm.uba.ar";
	
	Driver dcnet;
	
	dcnet.AgregarComputadora(c1, ConjuntoIc1);
	dcnet.AgregarComputadora(c2, ConjuntoIc2);
	dcnet.AgregarComputadora(c3, ConjuntoIc3);
	
	// ejemplo - Indexado en 0 
	Interfaz i1 = dcnet.IesimaInterfazDe(c1, 0); 
	Interfaz i2 = dcnet.IesimaInterfazDe(c2, 2);
	
	dcnet.Conectar(c1, i1, c2, i2);
	dcnet.CrearPaquete(c1, c2, 3);
	dcnet.AvanzarSegundo();	

	ASSERT_EQ(dcnet.laQueMasEnvio(), c1);
		
}