Пример #1
0
        public void GetMapPoints_ItemIdPassed_ShouldCallRepositoryWithItem(IMapPointRepository mapPointRepository, [FakeDb.AutoFixture.Content] Data.Items.Item item)
        {
            var controller = new MapsController(mapPointRepository);

            controller.GetMapPoints(item.ID.Guid);
            mapPointRepository.GetAll(item).ReceivedWithAnyArgs(1);
        }
Пример #2
0
    public void GetMapPoints_ItemIdPassed_PointsReturnedFormRepo(IMapPointRepository mapPointRepository, Db db, MapPoint[] points,[FakeDb.AutoFixture.Content]Data.Items.Item item)
    {
      mapPointRepository.GetAll(null).ReturnsForAnyArgs(points);

      var controller = new MapsController(mapPointRepository);
      var actualPoints = controller.GetMapPoints(item.ID.Guid).Data as IEnumerable<MapPoint>;
      actualPoints.ShouldBeEquivalentTo(points);
    }
Пример #3
0
        public void GetMapPoints_ItemIdPassed_PointsReturnedFormRepo(IMapPointRepository mapPointRepository, Db db, MapPoint[] points, [FakeDb.AutoFixture.Content] Data.Items.Item item)
        {
            mapPointRepository.GetAll(null).ReturnsForAnyArgs(points);

            var controller   = new MapsController(mapPointRepository);
            var actualPoints = controller.GetMapPoints(item.ID.Guid).Data as IEnumerable <MapPoint>;

            actualPoints.ShouldBeEquivalentTo(points);
        }
Пример #4
0
        public FakeRouteRepository(IMapPointRepository fakeMapPointRepository = null)
        {
            if (fakeMapPointRepository == null)
            {
                fakeMapPointRepository = new FakeMapPointRepository();
            }

            _fakeMapPointRepository = fakeMapPointRepository;
        }
Пример #5
0
        public MapController(IHostingEnvironment host, IConfiguration configuration)
        {
            _configuration = configuration;

            API_KEY = _configuration.GetValue <string>("IncomingMapAPIKey");

            var dataFolderPath = host.ContentRootPath + @"/_datastore/";

            Settings = SettingsRepository.GetSettings(dataFolderPath);
            db       = new SqLiteMapPointRepository(dataFolderPath);
        }
Пример #6
0
        public MapPointServiceTests()
        {
            if (_repository == null)
            {
                _repository = new FakeMapPointRepository();
            }

            if (_service == null)
            {
                _service = new MapPointService(_repository);
            }
        }
Пример #7
0
 public FakeRouteService(IMapPointRepository fakeMapPointRepository = null)
 {
     _fakeRouteRepository    = new FakeRouteRepository(fakeMapPointRepository);
     _fakeMapPointRepository = fakeMapPointRepository;
 }
Пример #8
0
 public MapsController(IMapPointRepository mapPointRepository)
 {
     this.mapPointRepository = mapPointRepository;
 }
Пример #9
0
 public MapPointService(IMapPointRepository repository)
 {
     this.repository = repository;
 }
Пример #10
0
 public MapPointService(IMapPointRepository repository)
     : base(repository)
 {
 }
Пример #11
0
        public void Constructor_ShouldNotThrow(IMapPointRepository mapPointRepository)
        {
            Action act = () => new MapsController(mapPointRepository);

            act.ShouldNotThrow();
        }
Пример #12
0
 public void GetMapPoints_ItemIdPassed_ShouldCallRepositoryWithItem(IMapPointRepository mapPointRepository, [FakeDb.AutoFixture.Content]Data.Items.Item item)
 {
   var controller = new MapsController(mapPointRepository);
   controller.GetMapPoints(item.ID.Guid);
   mapPointRepository.GetAll(item).ReceivedWithAnyArgs(1);
 }
Пример #13
0
 public void Constructor_ShouldNotThrow(IMapPointRepository mapPointRepository)
 {
   Action act = () => new MapsController(mapPointRepository);
   act.ShouldNotThrow();
 }
Пример #14
0
 public MapsController(IMapPointRepository mapPointRepository)
 {
   this.mapPointRepository = mapPointRepository;
 }