<commit_before>modulePilas('Cuadricula Test',{
  beforeEach: function(){

    this.cuadricula = new Cuadricula(0, 0, 3, 5,
         { alto: 300, ancho: 200 },
         //implica casilla.ancho==40 && casilla.alto==100
         { grilla: 'invisible.png', cantColumnas: 1 });
         this.actor1 = new AlienAnimado(0,0);
          this.actor2 = new AlienAnimado(0,0);
          this.actor3 = new AlienAnimado(0,0);

  },


  afterEach: function(){
    this.cuadricula.eliminar();
    this.actor1.eliminar();
     this.actor2.eliminar();
     this.actor3.eliminar();

  }
});

testPilas('Set Ancho',3, function(assert) {
      this.cuadricula.setAncho(100);
      assert.equal(this.cuadricula.ancho,100);
      assert.equal(this.cuadricula.casilla(0,0).ancho,20);
      assert.equal(this.cuadricula.casilla(0,0).alto,100);
       /*Modifica el ancho de las casillas pero no el alto*/
});

testPilas('Set Alto ',3, function(assert) {
      this.cuadricula.setAlto(600);
      assert.equal(this.cuadricula.alto,600);
      assert.equal(this.cuadricula.casilla(0,0).ancho,40);
      assert.equal(this.cuadricula.casilla(0,0).alto,200);
});


testPilas('Colisionan',6, function(assert) {
      this.cuadricula.agregarActor(this.actor1,0,0);
      this.cuadricula.agregarActor(this.actor2,0,0);
      this.cuadricula.agregarActor(this.actor3,0,1);

      assert.equal(this.cuadricula.colisionan(this.actor1,this.actor2),true);
      assert.equal(this.cuadricula.colisionan(this.actor2,this.actor1),true);
      assert.equal(this.cuadricula.colisionan(this.actor1,this.actor3),false);
      assert.equal(this.cuadricula.colisionan(this.actor3,this.actor1),false);
      assert.equal(this.cuadricula.colisionan(this.actor3,this.actor2),false);
      assert.equal(this.cuadricula.colisionan(this.actor2,this.actor3),false);


});

testPilas('Casilla ',7, function(assert) {

      assert.equal(this.cuadricula.casilla(0,0)!=this.cuadricula.casilla(0,1),true,'son distintas');
      assert.equal(this.cuadricula.casilla(0,0).nroFila,0);
      assert.equal(this.cuadricula.casilla(0,0).nroColumna,0);
      assert.equal(this.cuadricula.casilla(0,1).nroFila,0);
      assert.equal(this.cuadricula.casilla(0,1).nroColumna,1);
      assert.equal(this.cuadricula.casilla(1,1).nroColumna,1);
      assert.equal(this.cuadricula.casilla(1,1).nroFila,1);

});

/*
testPilas('Constructor',0, function(assert) {
      this.cuadricula.setAlto(600);<commit_msg>test de cuadricula<commit_after>modulePilas('Cuadricula Test',{
  beforeEach: function(){

    this.cuadricula = new Cuadricula(0, 0, 3, 5,
         { alto: 300, ancho: 200 },
         //implica casilla.ancho==40 && casilla.alto==100
         { grilla: 'invisible.png', cantColumnas: 1 });
         this.actor1 = new AlienAnimado(0,0);
          this.actor2 = new AlienAnimado(0,0);
          this.actor3 = new AlienAnimado(0,0);

  },


  afterEach: function(){
    this.cuadricula.eliminar();
    this.actor1.eliminar();
     this.actor2.eliminar();
     this.actor3.eliminar();

  }
});

testPilas('Set Ancho',3, function(assert) {
      this.cuadricula.setAncho(100);
      assert.equal(this.cuadricula.ancho,100);
      assert.equal(this.cuadricula.casilla(0,0).ancho,20);
      assert.equal(this.cuadricula.casilla(0,0).alto,100);
       /*Modifica el ancho de las casillas pero no el alto*/
});

testPilas('Set Alto ',3, function(assert) {
      this.cuadricula.setAlto(600);
      assert.equal(this.cuadricula.alto,600);
      assert.equal(this.cuadricula.casilla(0,0).ancho,40);
      assert.equal(this.cuadricula.casilla(0,0).alto,200);
});


testPilas('Colisionan',6, function(assert) {
      this.cuadricula.agregarActor(this.actor1,0,0);
      this.cuadricula.agregarActor(this.actor2,0,0);
      this.cuadricula.agregarActor(this.actor3,0,1);

      assert.equal(this.cuadricula.colisionan(this.actor1,this.actor2),true);
      assert.equal(this.cuadricula.colisionan(this.actor2,this.actor1),true);
      assert.equal(this.cuadricula.colisionan(this.actor1,this.actor3),false);
      assert.equal(this.cuadricula.colisionan(this.actor3,this.actor1),false);
      assert.equal(this.cuadricula.colisionan(this.actor3,this.actor2),false);
      assert.equal(this.cuadricula.colisionan(this.actor2,this.actor3),false);


});

testPilas('Casilla ',7, function(assert) {
      assert.equal(this.cuadricula.casilla(0,0)!=this.cuadricula.casilla(0,1),true,'son distintas');
      assert.equal(this.cuadricula.casilla(0,0).nroFila,0);
      assert.equal(this.cuadricula.casilla(0,0).nroColumna,0);
      assert.equal(this.cuadricula.casilla(0,1).nroFila,0);
      assert.equal(this.cuadricula.casilla(0,1).nroColumna,1);
      assert.equal(this.cuadricula.casilla(1,1).nroColumna,1);
      assert.equal(this.cuadricula.casilla(1,1).nroFila,1);
});

testPilas('Mover a casilla derecha ',1, function(assert) {

      this.cuadricula.agregarActor(this.actor1,0,0);
      var x= this.actor1.x;
      var y= this.actor1.y;
      this.actor1.hacer_luego(MoverACasillaDerecha)
      assert.equal(this.actor1.x=x+this.cuadricula.casilla(0,0).ancho());


});




/*
testPilas('Constructor',0, function(assert) {
      this.cuadricula.setAlto(600);
{'fraction_non_alphanumeric': 0.16583011583011584, 'fraction_numerical': 0.044015444015444015, 'mean_word_length': 4.01063829787234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3733462', 'n_tokens_mistral': 2133, 'n_tokens_neox': 2048, 'n_words': 188}