Skip to content

Commit

Permalink
Add DTSX test
Browse files Browse the repository at this point in the history
Fix Format=Qualified/Unqualified attribute (fix #172)
  • Loading branch information
Michael Ganss committed Mar 13, 2020
1 parent 89e1ff1 commit 9bc1573
Show file tree
Hide file tree
Showing 5 changed files with 3,692 additions and 5 deletions.
2 changes: 1 addition & 1 deletion XmlSampleGenerator/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public override string GenerateValue() {
decimal result = 0;
if(AllowedValues != null) {
try {
result = (decimal)AllowedValues[occurNum++ % AllowedValues.Count];
result = (decimal)Convert.ChangeType(AllowedValues[occurNum++ % AllowedValues.Count], typeof(decimal));
}
catch(OverflowException) {
occurNum = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@
<None Update="xsd\client\client.xsd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="xsd\dtsx\dtsx2.xsd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="xsd\elster-xml-datenabholung5\datenabholung_5.xsd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
11 changes: 10 additions & 1 deletion XmlSchemaClassGenerator.Tests/XmlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private IEnumerable<string> ConvertXml(string name, string xsd, Generator genera
const string TableauPattern = @"xsd\ts-api\*.xsd";
const string VSTstPattern = @"xsd\vstst\vstst.xsd";
const string BpmnPattern = @"xsd\bpmn\*.xsd";
const string DtsxPattern = @"xsd\dtsx\dtsx2.xsd";

// IATA test takes too long to perform every time

Expand Down Expand Up @@ -204,6 +205,14 @@ public void TestTableau()
TestSamples("Tableau", TableauPattern);
}

[Fact, TestPriority(1)]
[UseCulture("en-US")]
public void TestDtsx()
{
Compiler.Generate("Dtsx", DtsxPattern, new Generator());
TestSamples("Dtsx", DtsxPattern);
}

[Fact, TestPriority(1)]
[UseCulture("en-US")]
public void TestVSTst()
Expand Down Expand Up @@ -748,7 +757,7 @@ public partial class Group_Name
[System.Xml.Serialization.XmlTextAttribute()]
public string Value { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute(""justify"", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlAttributeAttribute(""justify"")]
public SimpleType Justify { get; set; }
/// <summary>
Expand Down
Loading

0 comments on commit 9bc1573

Please sign in to comment.