Example #1
0
        private bool VerifyAllExpectedCarAreInResponse(string[] expectedCarMakers, List <CarInfo> actualCarInfoList)
        {
            bool allCarInfoMatched = true;

            foreach (var carmake in expectedCarMakers)
            {
                CarInfo expectedCarInfo = _apiTestContext.CarsRepository.Find(car => car.make.Equals(carmake));
                CarInfo actualCarInfo   = actualCarInfoList.Find(car => car.make.Equals(carmake));
                allCarInfoMatched = allCarInfoMatched && expectedCarInfo.Equals(actualCarInfo);
                if (!allCarInfoMatched)
                {
                    Console.WriteLine($"CarInfo Unmatched for Make {carmake}");
                }
            }

            return(allCarInfoMatched);
        }