コード例 #1
0
        public async void GetByManufacturerIdValid()
        {
            var            vehicle    = EntitiesFactory.GetNewVehicle();
            List <Vehicle> listReturn = EntitiesFactory.GetVehicleList();

            _vehicleRepository.GetByManufacturerId(vehicle.ManufacturerId).Returns(listReturn);

            IEnumerable <Vehicle> result = await _vehicleService.GetByManufacturerId(vehicle.ManufacturerId);

            result.Should().NotBeNull();
        }
コード例 #2
0
        public async void GetByIdsValid()
        {
            List <Vehicle> listReturn = EntitiesFactory.GetVehicleList();

            string[] ids = EntitiesFactory.GetArrayStringIds();
            _vehicleRepository.GetByIds(ids).Returns(listReturn);

            IEnumerable <Vehicle> result = await _vehicleService.GetByIds(ids);

            result.Should().NotBeNull();
        }
コード例 #3
0
        public async void ImportInvalid(string id, string companyId, string name, string manufacturerId)
        {
            List <Vehicle> vehicleList = EntitiesFactory.GetVehicleList();
            var            vehicle     = EntitiesFactory.GetNewVehicleParametrized(id, name, companyId, manufacturerId);

            vehicleList.Add(vehicle);
            _vehicleRepository.Import(vehicleList).Returns(true);

            bool result = await _vehicleService.Import(vehicleList);

            result.Should().BeFalse();
        }