Example #1
0
        public async Task <IEnumerable <BaseCarInfo> > GetBaseInfoAboutCars(IEnumerable <int> autoIds)
        {
            var cars = new List <BaseCarInfo>();

            foreach (var autoId in autoIds)
            {
                string allCarInfo = await GetAllCarInfo(autoId);

                cars.Add(_carMapper.MapToBaseCarInfoObject(allCarInfo));
            }
            return(cars);
        }
Example #2
0
        public async Task MapToBaseCarInfoObject_CorrectJsonStringObject_ReturnsCorrectBaseCarInfoObject()
        {
            // Arrange
            using (var streamReader = new StreamReader($"{_testFilesFolderPath}allCarInfoTestFile.json"))
            {
                string jsonString = await streamReader.ReadToEndAsync();

                // Act
                BaseCarInfo baseCarInfo = _carMapper.MapToBaseCarInfoObject(jsonString);

                // Assert
                Assert.IsType <BaseCarInfo>(baseCarInfo);
                Assert.True(baseCarInfo.IsValid());
            }
        }