Beispiel #1
0
        public void TestDeserializeThenSerializeRealData_GetManufacturerDetails_Honda()
        {
            const string RealDataFile = @"Data/GetManufacturerDetails_Honda.xml";

            var deserializedResults = SerializeConfig <GetManufacturerDetails> .DeserializeUsingXmlSerializer(RealDataFile);

            Assert.AreEqual(13, deserializedResults.ManufacturerDetails.Count);

            // Reserialize the data, but to a temp file
            string tempFile = System.IO.Path.GetTempFileName();

            SerializeConfig <GetManufacturerDetails> .SerializeUsingXmlSerializer(tempFile, deserializedResults);

            UnitTest1.CompareFiles(tempFile, RealDataFile);
        }
Beispiel #2
0
        public void TestDeserializeThenSerializeRealData_GetModelsForMakeIdYear_474_2015()
        {
            const string RealDataFile = @"Data/GetModelsForMakeIdYear_474_2015.xml";

            var deserializedResults = SerializeConfig <GetMakeModels> .DeserializeUsingXmlSerializer(RealDataFile);

            Assert.AreEqual(169, deserializedResults.MakeModels.Count);

            // Reserialize the data, but to a temp file
            string tempFile = System.IO.Path.GetTempFileName();

            SerializeConfig <GetMakeModels> .SerializeUsingXmlSerializer(tempFile, deserializedResults);

            UnitTest1.CompareFiles(tempFile, RealDataFile);
        }
Beispiel #3
0
        public void TestDeserializeThenSerializeRealData_GetAllMakes()
        {
            const string RealDataFile = @"Data/GetAllMakes.xml";

            var deserializedResults = SerializeConfig <GetAllVehicleMakes> .DeserializeUsingXmlSerializer(RealDataFile);

            Assert.AreEqual(8716, deserializedResults.AllVehicleMakes.Count);
            Assert.AreEqual(deserializedResults.Count, deserializedResults.AllVehicleMakes.Count);
            Assert.IsTrue(deserializedResults.AllVehicleMakes.Any(x => x.MakeName == "Tesla"));
            Assert.IsTrue(deserializedResults.AllVehicleMakes.Any(x => x.MakeName == "Honda"));

            // Reserialize the data, but to a temp file
            string tempFile = System.IO.Path.GetTempFileName();

            SerializeConfig <GetAllVehicleMakes> .SerializeUsingXmlSerializer(tempFile, deserializedResults);

            UnitTest1.CompareFiles(tempFile, RealDataFile);
        }