Index: DamEngine/trunk/src/Deltares.DamEngine.Io.Tests/DamXmlSerializationTests.cs =================================================================== diff -u -r3893 -r4000 --- DamEngine/trunk/src/Deltares.DamEngine.Io.Tests/DamXmlSerializationTests.cs (.../DamXmlSerializationTests.cs) (revision 3893) +++ DamEngine/trunk/src/Deltares.DamEngine.Io.Tests/DamXmlSerializationTests.cs (.../DamXmlSerializationTests.cs) (revision 4000) @@ -19,10 +19,9 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Deltares.DamEngine.Io.XmlInput; using Deltares.DamEngine.Io.XmlOutput; using KellermanSoftware.CompareNetObjects; -using Input = Deltares.DamEngine.Io.XmlInput.Input; -using InputDamProjectType = Deltares.DamEngine.Io.XmlInput.InputDamProjectType; using NUnit.Framework; namespace Deltares.DamEngine.Io.Tests @@ -46,46 +45,52 @@ CompareInput(sourceInput, destinationInput); } + [Test] + public void CanReadWriteOutputObject() + { + const string filename = "Output.xml"; + Output sourceOutput = CreatePopulatedOutput(); + DamXmlSerialization.SaveOutputAsXmlFile(filename, sourceOutput); + Output destinationOutput = DamXmlSerialization.LoadOutputFromXmlFile(filename); + CompareOutput(sourceOutput, destinationOutput); + } + private Input CreatePopulatedInput() { - Input input = new Input(); + var input = new Input(); input.DamProjectType = InputDamProjectType.Design; return input; } private void CompareInput(Input expected, Input actual) { - var compare = new CompareLogic { Config = { MaxDifferences = 100 } }; - var result = compare.Compare(expected, actual); + var compare = new CompareLogic + { + Config = + { + MaxDifferences = 100 + } + }; + ComparisonResult result = compare.Compare(expected, actual); Assert.AreEqual(0, result.Differences.Count, "Differences found read/write Input object"); } - [Test] - public void CanReadWriteOutputObject() - { - const string filename = "Output.xml"; - Output sourceOutput = CreatePopulatedOutput(); - DamXmlSerialization.SaveOutputAsXmlFile(filename, sourceOutput); - Output destinationOutput = DamXmlSerialization.LoadOutputFromXmlFile(filename); - CompareOutput(sourceOutput, destinationOutput); - } - private Output CreatePopulatedOutput() { var output = new Output(); output.Results = new OutputResults(); output.Results.CalculationMessages = new Message[3]; - output.Results.CalculationMessages[0] = new Message() + output.Results.CalculationMessages[0] = new Message { MessageType = MessageMessageType.Error, Message1 = "test1" }; - output.Results.CalculationMessages[1] = new Message() + output.Results.CalculationMessages[1] = new Message { MessageType = MessageMessageType.Warning, Message1 = "test2" }; - output.Results.CalculationMessages[2] = new Message() + output.Results.CalculationMessages[2] = new Message { MessageType = MessageMessageType.Info, Message1 = "test3" @@ -95,11 +100,15 @@ private void CompareOutput(Output expected, Output actual) { - var compare = new CompareLogic { Config = { MaxDifferences = 100 } }; - var result = compare.Compare(expected, actual); + var compare = new CompareLogic + { + Config = + { + MaxDifferences = 100 + } + }; + ComparisonResult result = compare.Compare(expected, actual); Assert.AreEqual(0, result.Differences.Count, "Differences found read/write Output object"); - } } - -} +} \ No newline at end of file