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); }
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); }
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); }
public FakeRouteRepository(IMapPointRepository fakeMapPointRepository = null) { if (fakeMapPointRepository == null) { fakeMapPointRepository = new FakeMapPointRepository(); } _fakeMapPointRepository = fakeMapPointRepository; }
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); }
public MapPointServiceTests() { if (_repository == null) { _repository = new FakeMapPointRepository(); } if (_service == null) { _service = new MapPointService(_repository); } }
public FakeRouteService(IMapPointRepository fakeMapPointRepository = null) { _fakeRouteRepository = new FakeRouteRepository(fakeMapPointRepository); _fakeMapPointRepository = fakeMapPointRepository; }
public MapsController(IMapPointRepository mapPointRepository) { this.mapPointRepository = mapPointRepository; }
public MapPointService(IMapPointRepository repository) { this.repository = repository; }
public MapPointService(IMapPointRepository repository) : base(repository) { }
public void Constructor_ShouldNotThrow(IMapPointRepository mapPointRepository) { Action act = () => new MapsController(mapPointRepository); act.ShouldNotThrow(); }
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); }