Пример #1
0
 public LocationService(ILocationDataService locationDataService, IMapper mapper,
                        IAssetDataService assetDataService)
 {
     this.locationDataService = locationDataService;
     this.mapper           = mapper;
     this.assetDataService = assetDataService;
 }
Пример #2
0
 public GetLocationsCommandHandler(IMapper mapper, IAssetDataService assetDataService,
                                   ILocationDataService locationDataService)
 {
     this.mapper              = mapper;
     this.assetDataService    = assetDataService;
     this.locationDataService = locationDataService;
 }
Пример #3
0
 public LocationService(ILocationDataService locationDataService, IMapper mapper,
                        IDeviceDataService deviceDataService)
 {
     this.locationDataService = locationDataService;
     this.mapper            = mapper;
     this.deviceDataService = deviceDataService;
 }
Пример #4
0
 public LocationService(ILocationDataService locationDataService, IMapper mapper,
                        IObjectDataService objectDataService)
 {
     this.locationDataService = locationDataService;
     this.mapper            = mapper;
     this.objectDataService = objectDataService;
 }
Пример #5
0
 public LocationDataImporter(IDataServiceFactory dataServiceFactory)
 {
     _locationServiceProxy = dataServiceFactory.CreateLocationDataService(DataSourceType.Remote);
     _snapshotServiceProxy = dataServiceFactory.CreateLocationSnapshotDataService(DataSourceType.Remote);
     _snapshotService      = dataServiceFactory.CreateLocationSnapshotDataService(DataSourceType.Local);
     _pictureServiceProxy  = dataServiceFactory.CreatePictureService(DataSourceType.Remote);
     _pictureService       = dataServiceFactory.CreatePictureService(DataSourceType.Local);
 }
        private void SetUp()
        {
            _locations = new List <Location>
            {
                new Location {
                    Id = 1, Name = "Barcelona"
                },
                new Location {
                    Id = 2, Name = "Prague"
                },
                new Location {
                    Id = 3, Name = "Frankfurt"
                }
            };
            _snapshotGroups = new List <SnapshotGroup>
            {
                new SnapshotGroup {
                    Name = "December 2018"
                },
                new SnapshotGroup {
                    Name = "March 2019"
                }
            };
            Task <IEnumerable <SnapshotGroup> > dataFetchOperation()
            {
                var tcs = new TaskCompletionSource <IEnumerable <SnapshotGroup> >();

                tcs.SetResult(_snapshotGroups);
                return(tcs.Task);
            };
            _snapshotDataService = Substitute.For <ILocationSnapshotDataService>();
            _snapshotDataService.ChooseGroupByOperation(Arg.Any <GroupByCriteria>())
            .Returns(dataFetchOperation);
            _locationDataService = Substitute.For <ILocationDataService>();
            _locationDataService.GetAllLocationsAsync()
            .Returns(_ =>
            {
                var tcs = new TaskCompletionSource <IEnumerable <Location> >();
                tcs.SetResult(_locations);
                return(tcs.Task);
            });
            _dialogService = Substitute.For <IDialogService>();
            _dialogService.ShowConfirmationAsync(Arg.Any <string>())
            .Returns(_ =>
            {
                var tcs = new TaskCompletionSource <ConfirmationAnswer>();
                tcs.SetResult(ConfirmationAnswer.OK);
                return(tcs.Task);
            });
            _pictureService          = Substitute.For <IPictureService>();
            _locationDataImporter    = Substitute.For <ILocationDataImporter>();
            _dataSourceGovernor      = Substitute.For <IDataSourceGovernor>();
            _connectivityService     = Substitute.For <IConnectivityService>();
            _navigationService       = Substitute.For <INavigationService>();
            _platformSpecificActions = Substitute.For <IPlatformSpecificActions>();
        }
        private void SetUp()
        {
            _dataServiceFactory   = Substitute.For <IDataServiceFactory>();
            _locationServiceProxy = Substitute.For <ILocationDataService>();
            _snapshotServiceProxy = Substitute.For <ILocationSnapshotDataService>();
            _snapshotService      = Substitute.For <ILocationSnapshotDataService>();
            _pictureServiceProxy  = Substitute.For <IPictureService>();
            _pictureService       = Substitute.For <IPictureService>();

            _dataServiceFactory.CreateLocationDataService(DataSourceType.Remote).Returns(_locationServiceProxy);
            _dataServiceFactory.CreateLocationSnapshotDataService(DataSourceType.Remote).Returns(_snapshotServiceProxy);
            _dataServiceFactory.CreateLocationSnapshotDataService(DataSourceType.Local).Returns(_snapshotService);
            _dataServiceFactory.CreatePictureService(DataSourceType.Remote).Returns(_pictureServiceProxy);
            _dataServiceFactory.CreatePictureService(DataSourceType.Local).Returns(_pictureService);

            _locationToImport = new Location
            {
                Id   = 1,
                Name = "Barcelona"
            };
            _snapshotsToImport = new List <LocationSnapshot>
            {
                new LocationSnapshot
                {
                    Id              = 1,
                    LocationId      = 1,
                    PictureFileName = "Barcelona1.jpg"
                },
                new LocationSnapshot
                {
                    Id              = 2,
                    LocationId      = 1,
                    PictureFileName = "Barcelona2.jpg"
                },
            };

            _snapshotService.GetSnapshotsByLocationIdAsync(Arg.Any <int>())
            .Returns(_ =>
            {
                var tcs = new TaskCompletionSource <IEnumerable <LocationSnapshot> >();
                tcs.SetResult(_snapshotsToImport);
                return(tcs.Task);
            });

            _pictureData = new byte[] { 1, 2, 3, 4 };
            _pictureService.GetSnapshotContentAsync(Arg.Any <LocationSnapshot>())
            .Returns(_ =>
            {
                var tcs = new TaskCompletionSource <byte[]>();
                tcs.SetResult(_pictureData);
                return(tcs.Task);
            });
        }
Пример #8
0
        public LocationsViewModel(ILocationDataService locationDataService,
                                  ILocationSnapshotDataService locationSnapshotDataService,
                                  INavigationService navigationService,
                                  IDialogService dialogService,
                                  IPictureService pictureService,
                                  ILocationDataImporter locationDataImporter,
                                  IDataSourceGovernor dataSourceGovernor,
                                  IConnectivityService connectivityService,
                                  IPlatformSpecificActions platformSpecificActions)
        {
            _locationDataService         = locationDataService;
            _locationSnapshotDataService = locationSnapshotDataService;
            _navigationService           = navigationService;
            _dialogService           = dialogService;
            _pictureService          = pictureService;
            _locationDataImporter    = locationDataImporter;
            _dataSourceGovernor      = dataSourceGovernor;
            _connectivityService     = connectivityService;
            _platformSpecificActions = platformSpecificActions;

            GroupByOptions = new List <GroupByCriteria>
            {
                GroupByCriteria.None,
                GroupByCriteria.CreatedDate,
                GroupByCriteria.Longitude,
                GroupByCriteria.Latitude,
                GroupByCriteria.Altitude
            };
            SelectedLocations  = new List <Location>();
            GroupBy            = GroupByCriteria.None;
            SelectionMode      = SelectionMode.None;
            IsItemClickEnabled = true;
            IsInBrowseMode     = true;
            IsInEditMode       = false;
            IsInSelectMode     = false;
        }
Пример #9
0
 public ComplexNetOpAsyncController(
     ILocationDataService locationDataService
     )
 {
     _locationDataService = locationDataService;
 }
Пример #10
0
 public LocationDataController(ILocationDataService locationDataService)
 {
     this.locationDataService = locationDataService;
 }
Пример #11
0
 public LocationsController(ILocationDataService locationDataService,
                            ILogger <LocationsController> logger)
 {
     _locationDataService = locationDataService;
     _logger = logger;
 }
Пример #12
0
 public BasicNetOpAsyncController(
     ILocationDataService locationDataService
     )
 {
     _locationDataService = locationDataService;
 }
Пример #13
0
 public ActivitiesController(IActivitiesService activitiesService, ILocationDataService locationDataService)
 {
     _activitiesService = activitiesService;
     _locationDataService = locationDataService;
 }
Пример #14
0
 public LocationController(ILocationDataService locationDataService, ILocationService locationService)
 {
     _locationDataService = locationDataService;
     _locationService = locationService;
 }