/// <summary>
        /// Get list of vehicles
        /// </summary>
        /// <returns>AutomaticCollection&lt;Vehicle&gt;</returns>
        public async Task <AutomaticCollection <Vehicle> > GetVehiclesAsync(VehiclesRequest request = null)
        {
            if (request == null)
            {
                return(await GetAsync <AutomaticCollection <Vehicle> >(VehicleResource));
            }

            return(await GetAsync <AutomaticCollection <Vehicle> >(VehicleResource, request.CreateParameters()));
        }
Esempio n. 2
0
        /// <summary>
        /// Get list of vehicles
        /// </summary>
        /// <returns>AutomaticCollection&lt;Vehicle&gt;</returns>
        public async Task <AutomaticCollection <Vehicle> > GetVehiclesAsync(VehiclesRequest request = null)
        {
            const string path = "vehicle/";

            if (request == null)
            {
                return(await GetAsync <AutomaticCollection <Vehicle> >(path));
            }

            return(await GetAsync <AutomaticCollection <Vehicle> >(path, request.CreateParameters()));
        }
        public async Task GetAll_Default_Returns7Vehicles()
        {
            // Arrange
            var request = new VehiclesRequest {
                MaxResultCount = 20, SkipCount = 0
            };

            // Act
            var result = await _vehicleAppService.GetAll(request);

            // Assert
            result.Items.Count.ShouldBe(7);
            notificationSubscriptionManager.Verify(e => e.SubscribeAsync(It.IsAny <UserIdentifier>(), "VehicleStatusUpdate", null));
        }
        public async Task GetAll_KalesCustomer_Returns3Vehicles()
        {
            // Arrange
            var request = new VehiclesRequest {
                MaxResultCount = 20, SkipCount = 0, Customer = "Kalles Grustransporter AB"
            };

            // Act
            var result = await _vehicleAppService.GetAll(request);


            // Assert
            result.Items.Count.ShouldBe(3);
            notificationSubscriptionManager.Verify(e => e.SubscribeAsync(It.IsAny <UserIdentifier>(), "VehicleStatusUpdate", null));
        }