示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Which is the distance to jump?");
            var distance = Console.ReadLine();
            int travelDistance;

            if (int.TryParse(distance, out travelDistance))
            {
                var starshipBL = new StarshipBusinessLogic(new StarshipMapper(), new StarshipDataService(new HttpClientHandler(), new AppConfigurationManager()));
                var starships  = starshipBL.GetAll();

                foreach (var starship in starships)
                {
                    var numberOfJumps = starshipBL.GetNumberOfJumps(starship, travelDistance);
                    Console.WriteLine("Name:{0}.\tNumber of jumps:{1}", starship.Name, numberOfJumps);
                }
            }
            else
            {
                Console.WriteLine("The distance entered {0} is not a number", distance);
            }
            Console.WriteLine("Press any key to finish");
            Console.ReadKey();
        }
 public void Initialize()
 {
     starshipMapper          = new Mock <IStarshipMapper>();
     starshipDataService     = new Mock <IStarshipDataService>();
     starshipBusinessLogicUT = new StarshipBusinessLogic(starshipMapper.Object, starshipDataService.Object);
 }