Beispiel #1
0
            static void Main(string[] args)
            {
                var p1 = new Punto {
                    X = 5, Y = 6
                };
                var p2 = new Punto {
                    X = 1, Y = 2
                };
                var p3 = new Punto {
                    X = 5, Y = 6
                };

                Console.WriteLine("p1.getHashCode() = {0}", p1.GetHashCode());
                Console.WriteLine("p2.getHashCode() = {0}", p2.GetHashCode());
                Console.WriteLine("p3.getHashCode() = {0}", p3.GetHashCode());

                Console.WriteLine("p1.Equals(p2) = {0}", p1.Equals(p2));
                Console.WriteLine("p2.Equals(p3) = {0}", p2.Equals(p3));
                Console.WriteLine("p3.Equals(p1) = {0}", p3.Equals(p1));

                Console.WriteLine("p1 == p2 = {0}", p1 == p2);
                Console.WriteLine("p2 == p3 = {0}", p2 == p3);
                Console.WriteLine("p3 == p1 = {0}", p3 == p1);
            }
Beispiel #2
0
 public void BombitaConVelocidadNormalCambiaDePosicionEnUnaUnidadDentroDelMapaAlMoversePorPasillo()
 {
     this.movil = new Bombita(new Punto(0, 0));
     Punto posOriginal = this.movil.Posicion.Clonar();
     this.unMapa.AgregarPersonaje(this.movil);
     this.movil.Movimiento.CambiarADerecha();
     this.movil.Mover();
     Punto pos = new Punto(1, 0);
     Assert.IsTrue(pos.Equals(this.movil.Posicion));
 }