示例#1
0
        public async Task <DetailedCarInfo> GetDetailedCarInfo(int autoId)
        {
            string allCarInfo = await GetAllCarInfo(autoId);

            DetailedCarInfo detailedCarInfo = _carMapper.MapToDetailedCarInfoObject(allCarInfo);

            return(detailedCarInfo);
        }
示例#2
0
        public async Task MapToDetailedCarInfoObject_CorrectJsonStringObject_ReturnsCorrectDetailedCarInfoObject()
        {
            // Arrange
            using (var streamReader = new StreamReader($"{_testFilesFolderPath}allCarInfoTestFile.json"))
            {
                string jsonString = await streamReader.ReadToEndAsync();

                // Act
                DetailedCarInfo detailedCarInfo = _carMapper.MapToDetailedCarInfoObject(jsonString);

                // Assert
                Assert.IsType <DetailedCarInfo>(detailedCarInfo);
                Assert.True(detailedCarInfo.IsValid());
            }
        }