Exemplo n.º 1
0
        public async void CanRunMultipleGLOSARequests_ShouldReturnTrue()
        {
            // arrange

            //SETTINGS_ROUTE_DIRECTION_ANY = 0: - Not Supported Yet
            //SETTINGS_ROUTE_DIRECTION_IB = 1: - Not Supported Yet
            //SETTINGS_ROUTE_DIRECTION_OB = 2;

            var intersectionId = "1992";
            var route          = KMLHelper.GLOSATestRoute().ToList();
            var gpsHistory     = KMLHelper.GLOSATestRouteIntersectionHistory(intersectionId, 2);

            NavigationService navigationService = new NavigationService();

            var waypoint1  = navigationService.LocateWaypointOnRoute(WaypointDetectionMethod.GPSHistoryDirection, route, gpsHistory, 0, 0);
            var waypoint2  = navigationService.LocateWaypointOnRoute(WaypointDetectionMethod.GPSHistoryDirection, route, gpsHistory, 0, 1);
            var webService = new GLOSAWebService(null);

            //await Task.Run(async () => await webService.SyncMAPSPATAsync(KMLHelper.IntersectionIdOfPlacemark(waypoint1)));
            //await Task.Run(async () => await webService.SyncMAPSPATAsync(KMLHelper.IntersectionIdOfPlacemark(waypoint2)));
            var waypoint1Id = KMLHelper.IntersectionIdOfPlacemark(waypoint1);
            var waypoint2Id = waypoint2 != null?KMLHelper.IntersectionIdOfPlacemark(waypoint2) : null;

            await Task.Run(async() => await webService.SyncMAPSPATAsync(waypoint1Id, waypoint2Id));

            bool expectedResult = true;
            //act
            bool actualResult = waypoint1 != null;

            //assert
            Assert.Equal(expectedResult, actualResult);
        }
Exemplo n.º 2
0
        public override void Initialize()
        {
            CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

            Mvx.LazyConstructAndRegisterSingleton <IMvxMessenger, MvxMessengerHub>();
            Mvx.LazyConstructAndRegisterSingleton <IDataAnalyticsService, DataAnalyticsService>();
            Mvx.LazyConstructAndRegisterSingleton <ILocationService, LocationService>();

            ISNTPService sntpService = new SNTPService();

            Mvx.RegisterSingleton <ISNTPService>(sntpService);

            IGLOSAWebService gLOSAWebService = new GLOSAWebService(Mvx.Resolve <IDataAnalyticsService>());

            Mvx.RegisterSingleton <IGLOSAWebService>(gLOSAWebService);

            Mvx.RegisterType <IVehicleService, VehicleService>();

            RegisterAppStart <SpeedAdvisoryViewModel>();
        }