Add AttractMode deserialization test, fix issues

This commit is contained in:
Matt Nadareski
2023-07-13 13:16:37 -04:00
parent 4153931dfc
commit 11b635e06a
6 changed files with 209 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
using System;
using System.Xml.Serialization;
using Xunit;
namespace SabreTools.Test.Parser
@@ -29,6 +28,26 @@ namespace SabreTools.Test.Parser
}
}
[Fact]
public void AttractModeDeserializeTest()
{
// Open the file for reading
string filename = System.IO.Path.Combine(Environment.CurrentDirectory, "TestData", "test-attractmode-files.txt");
// Deserialize the file
var dat = Serialization.AttractMode.Deserialize(filename);
// Validate the values
Assert.NotNull(dat?.Row);
Assert.Equal(11, dat.Row.Length);
// Validate we're not missing any attributes or elements
foreach (var file in dat.Row)
{
Assert.Null(file.ADDITIONAL_ELEMENTS);
}
}
[Fact]
public void ListxmlDeserializeTest()
{