示例#1
0
        public void Repro()
        {
            Asteroid  theExplodingAsteroidRef = new ExplodingAsteroid();
            SpaceShip theApolloSpacecraftRef  = new ApolloSpacecraft();
            var       collideWith             = theExplodingAsteroidRef.CollideWith(theApolloSpacecraftRef);

            Check.That(collideWith).IsEqualTo("ExplodingAsteroid hit a ApolloSpacecraft");
        }
示例#2
0
 public override string CollideWith(ApolloSpacecraft ship)
 {
     return($"ExplodingAsteroid hit an {ship.GetShipType()}");
 }
示例#3
0
 public virtual string CollideWith(ApolloSpacecraft ship)
 {
     return("Asteroid hit an ApolloSpacecraft");
 }