Exemplo n.º 1
0
        public void WhenConvertingAsposeCarsBinaryFileToXml_ThenValidDataStored()
        {
            var tempFilePath = Path.GetTempFileName();

            try
            {
                _supporter.Convert(BaseFilePath + BinaryExt, tempFilePath, CarFileFormat.Xml, true);

                var expectedHash = CarTestHelper.ComputeHashString(tempFilePath);
                Assert.AreEqual(expectedHash, "68a2b9a39c661eec489995b607a50331");
            }
            finally
            {
                File.Delete(tempFilePath);
            }
        }
Exemplo n.º 2
0
        public void WhenConvertingAsposeCarsJsonFileToXml_ThenValidDataStored()
        {
            var tempFilePath = Path.GetTempFileName();

            try
            {
                _supporter.Convert(BaseFilePath + JsonExt, tempFilePath, CarFileFormat.Xml, true);

                var expectedHash = CarTestHelper.ComputeHashString(tempFilePath);
                Assert.AreEqual(expectedHash, "3f1e0b3cddeb1b365b6bdf31d3200791");
            }
            finally
            {
                File.Delete(tempFilePath);
            }
        }
Exemplo n.º 3
0
        public void WhenConvertingAsposeCarsXmlFileToBinary_ThenValidDataStored()
        {
            var tempFilePath = Path.GetTempFileName();

            try
            {
                _supporter.Convert(BaseFilePath + XmlExt, tempFilePath, CarFileFormat.Binary, true);

                var expectedHash = CarTestHelper.ComputeHashString(tempFilePath);
                Assert.AreEqual(expectedHash, "1d56edb154f10056969880c90c07c493");
            }
            finally
            {
                File.Delete(tempFilePath);
            }
        }
Exemplo n.º 4
0
        public void WhenConvertingAsposeCarsBinaryFileToJson_ThenValidDataStored()
        {
            var tempFilePath = Path.GetTempFileName();

            try
            {
                _supporter.Convert(BaseFilePath + BinaryExt, tempFilePath, _jsonFileFormat, true);

                var expectedHash = CarTestHelper.ComputeHashString(tempFilePath);
                Assert.AreEqual(expectedHash, "f851e486c27e363c129009705d29bb96");
            }
            finally
            {
                File.Delete(tempFilePath);
            }
        }
Exemplo n.º 5
0
        public void WhenSavingAsposeCarsToXml_ThenValidDataStored()
        {
            var tempFilePath = Path.GetTempFileName();

            try
            {
                var cars = CarTestHelper.CreateDefaultCarCollection();
                _supporter.Save(tempFilePath, CarFileFormat.Xml, true, cars);

                var expectedHash = CarTestHelper.ComputeHashString(tempFilePath);
                Assert.AreEqual(expectedHash, "b808279ce0ea89b2fb29647650649812");
            }
            finally
            {
                File.Delete(tempFilePath);
            }
        }