示例#1
0
        public TakeHomeServiceTests()
        {
            _repository = new Mock <ITakeHomeRepository>();

            //Arrange
            _repository.Setup(s =>
                              s.GetRoutes("JFK", "YFR")).ReturnsAsync(RoutesFake.RoutesA);

            _repository.Setup(s =>
                              s.GetRoutes("JFK", "YYZ")).ReturnsAsync(RoutesFake.RoutesB);

            _repository.Setup(s =>
                              s.GetRoutes("YYZ", "YJT")).ReturnsAsync(RoutesFake.RoutesC);

            _repository.Setup(s =>
                              s.GetRoutes("YYZ", "GRU")).ReturnsAsync(RoutesFake.RoutesD);

            _repository.Setup(s =>
                              s.GetRoutes("YYZ", "XYZ")).ReturnsAsync(RoutesFake.RoutesE);

            _repository.Setup(s =>
                              s.GetRoutesInRange(It.IsAny <double>(), It.IsAny <double>(), It.IsAny <double>())).ReturnsAsync(RoutesFake.RoutesInRange);

            _service = new TakeHomeService(_repository.Object);
        }
 public GetShortestRouteHandler(ITakeHomeService service)
 {
     _service = service;
 }