From 374b1961e2c722fc65a406d726eb69bc1145b530 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 21 Jun 2023 13:13:04 +0200 Subject: [PATCH] zugferdtest: fix test form --- GUIs.Test.ZUGFeRDTest/Form1.vb | 53 +++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/GUIs.Test.ZUGFeRDTest/Form1.vb b/GUIs.Test.ZUGFeRDTest/Form1.vb index 40cea31b..fce9e422 100644 --- a/GUIs.Test.ZUGFeRDTest/Form1.vb +++ b/GUIs.Test.ZUGFeRDTest/Form1.vb @@ -126,38 +126,43 @@ Public Class Form1 Dim oArgs As New WorkerArgs() oArgs = LoadPropertyMapFor(oArgs) - If oDialogResult = DialogResult.OK Then - Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName) - Dim oResult = _zugferd.SerializeZUGFeRDDocument(oDoc) - oResult = _zugferd.ValidateZUGFeRDDocument(oResult) + Try + If oDialogResult = DialogResult.OK Then + Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName) + Dim oResult = _zugferd.ValidateZUGFeRDDocument(oDoc) + oResult = _zugferd.SerializeZUGFeRDDocument(oDoc) - WriteLog("Specification: " & oResult.Specification) - WriteLog("Embedded File Name: " & oResult.DataFileName) + WriteLog("Specification: " & oResult.Specification) + WriteLog("Embedded File Name: " & oResult.DataFileName) - Dim oSpecification = oResult.Specification + Dim oSpecification = oResult.Specification - If oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_10 Then - oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_DEFAULT - End If + If oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_10 Then + oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_DEFAULT + End If - Dim oPropertyMap = oArgs.PropertyMap. - Where(Function(kv) kv.Value.Specification = oSpecification). - ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value) + Dim oPropertyMap = oArgs.PropertyMap. + Where(Function(kv) kv.Value.Specification = oSpecification). + ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value) - Dim oResult2 = _zugferd.PropertyValues.CheckPropertyValues(oResult.SchemaObject, oPropertyMap, "test") + Dim oResult2 = _zugferd.PropertyValues.CheckPropertyValues(oResult.SchemaObject, oPropertyMap, "test") - WriteLog("Valid Properties: [{0}]", oResult2.ValidProperties.Count) - For Each Prop In oResult2.ValidProperties - WriteLog("Property: [{0}] = [{1}]", Prop.Description, Prop.Value) - Next + WriteLog("Valid Properties: [{0}]", oResult2.ValidProperties.Count) + For Each Prop In oResult2.ValidProperties + WriteLog("Property: [{0}] = [{1}]", Prop.Description, Prop.Value) + Next - WriteLog("Missing Properties: [{0}]", oResult2.MissingProperties.Count) - For Each Prop In oResult2.MissingProperties - WriteLog("Missing Property: [{0}]", Prop) - Next + WriteLog("Missing Properties: [{0}]", oResult2.MissingProperties.Count) + For Each Prop In oResult2.MissingProperties + WriteLog("Missing Property: [{0}]", Prop) + Next + + WriteLog("--------------------------------") + End If + Catch ex As Exception + MsgBox(ex.Message) + End Try - WriteLog("--------------------------------") - End If End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click