Esempio n. 1
0
        public void TestExtraError14()
        {
            var error = ExtraUtilities.Deserialize <ExtraErrorType>(LoadData("extra-error-1.xml"));

            Assert.NotNull(error);
            Assert.True(error.versionSpecified);
            Assert.Equal(ExtraErrorTypeVersion.Item10, error.version);
            Assert.Equal(ExtraErrorReasonType.INVALID_REQUEST, error.Reason);
            Assert.NotNull(error.RequestID);
            Assert.Equal("reqid", error.RequestID.Value);
            Assert.NotNull(error.ResponseID);
            Assert.Equal("resid", error.ResponseID.Value);
            Assert.Equal(XmlConvert.ToDateTime("2010-02-21T21:15:00", XmlDateTimeSerializationMode.Local), error.TimeStamp);
            Assert.NotNull(error.Application);
            Assert.NotNull(error.Application.Product);
            Assert.Equal("my-extra-server 1.0", error.Application.Product.Value);
            Assert.NotNull(error.Report);
            Assert.Equal(ExtraFlagWeight.Error, error.Report.highestWeight);
            Assert.NotNull(error.Report.Flag);
            Assert.Single(error.Report.Flag);
            var flag = error.Report.Flag[0];

            Assert.NotNull(flag);
            Assert.Equal(ExtraFlagWeight.Error, flag.weight);
            Assert.NotNull(flag.Code);
            Assert.Equal("0100", flag.Code.Value);
            Assert.NotNull(flag.Text);
            Assert.Equal("Der Request ist nicht wohlgeformt", flag.Text.Value);
            Assert.NotNull(flag.XPath);
            Assert.Equal("/a/b[4]/c[2]/d", flag.XPath.Value);
        }
Esempio n. 2
0
        public void DeserializePluginDataSource14()
        {
            var datasource = ExtraUtilities.Deserialize <DataSourceType>(LoadData("plugin.datasource.xml"));

            Assert.NotNull(datasource);
            Assert.True(datasource.versionSpecified);
            Assert.Equal(DataSourceTypeVersion.Item10, datasource.version);

            var dataContainer = datasource.DataContainer;

            Assert.NotNull(dataContainer);
            Assert.Equal("http://www.extra-standard.de/container/FILE", dataContainer.type);
            Assert.Equal("abc.xml", dataContainer.name);
            Assert.True(dataContainer.createdSpecified);
            Assert.Equal(XmlConvert.ToDateTime("2008-11-07T12:48:26", XmlDateTimeSerializationMode.Local), dataContainer.created);
            Assert.Equal("UTF-8", dataContainer.encoding);

            var dataSet = dataContainer.DataSet;

            Assert.NotNull(dataSet);
            Assert.Equal("abcde", dataSet.name);
            Assert.Equal("KKS-Auftragssatz", dataSet.type);
            Assert.True(dataSet.lastModifiedSpecified);
            Assert.Equal(XmlConvert.ToDateTime("2008-11-04T09:34:11", XmlDateTimeSerializationMode.Local), dataSet.lastModified);
        }
Esempio n. 3
0
        public void DeserializePluginContacts14()
        {
            var contacts = ExtraUtilities.Deserialize <ContactsType>(LoadData("plugin.contact.xml"));

            Assert.NotNull(contacts);
            Assert.True(contacts.versionSpecified);
            Assert.Equal(ContactsTypeVersion.Item10, contacts.version);
            Assert.NotNull(contacts.SenderContact);
            Assert.Equal(2, contacts.SenderContact.Length);

            var contact = contacts.SenderContact[0];

            Assert.NotNull(contact);
            Assert.Equal("Technischer Support 24/7", contact.usageHint);
            Assert.NotNull(contact.Endpoint);
            Assert.Single(contact.Endpoint);
            var endpoint = contact.Endpoint[0];

            Assert.NotNull(endpoint);
            Assert.Equal(EndpointTypeType.SMTP, endpoint.type);
            Assert.Equal("*****@*****.**", endpoint.Value);

            contact = contacts.SenderContact[1];
            Assert.NotNull(contact);
            Assert.Equal("Allgemeine Informationen", contact.usageHint);
            Assert.NotNull(contact.Endpoint);
            Assert.Single(contact.Endpoint);
            endpoint = contact.Endpoint[0];
            Assert.NotNull(endpoint);
            Assert.Equal(EndpointTypeType.SMTP, endpoint.type);
            Assert.Equal("*****@*****.**", endpoint.Value);
        }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     // If the user press SPACE while inside the save point, enter the menu
     if (ExtraUtilities.checkPress(" ") && playerIsPresent)
     {
         Debug.Log("Spawn point - Interaction");
         //Interact (player);
     }
 }
Esempio n. 5
0
        public void TestFailure(string resourceName)
        {
            var data     = LoadData(resourceName);
            var document = ExtraUtilities.Deserialize <TransportRequestType>(data);

            Assert.NotNull(document);
            var validator = new GkvExtraValidator(ExtraMessageType.GetProcessingResult, ExtraTransportDirection.Request, false);

            Assert.Throws <XmlSchemaValidationException>(() => validator.Validate(data));
        }
Esempio n. 6
0
        public void TestMessageResponse(string resourceName)
        {
            var data     = LoadData(resourceName);
            var document = ExtraUtilities.Deserialize <TransportResponseType>(data);

            Assert.NotNull(document);
            var validator = new GkvExtraValidator(ExtraMessageType.SupplyData, ExtraTransportDirection.Response, false);
            var now       = DateTimeOffset.Now;

            validator.Validate(data);
            Assert.True(now <= validator.LastGetEntityTimestamp);
        }
Esempio n. 7
0
        public void TestConfirmationRequest(string resourceName)
        {
            var data     = LoadData(resourceName);
            var document = ExtraUtilities.Deserialize <TransportRequestType>(data);

            Assert.NotNull(document);
            var validator = new GkvExtraValidator(ExtraMessageType.AcknowledgeProcessingResult, ExtraTransportDirection.Request, false);
            var now       = DateTimeOffset.Now;

            validator.Validate(data);
            Assert.True(now <= validator.LastGetEntityTimestamp);
        }
Esempio n. 8
0
        public void TestConfirmationBody()
        {
            var data     = LoadData("KomServer-Empfangsquittung-Body.xml");
            var document = ExtraUtilities.Deserialize <ConfirmationOfReceiptType>(data);

            Assert.NotNull(document);
            var validator = new GkvExtraValidator(ExtraMessageType.AcknowledgeProcessingResultQuery, ExtraTransportDirection.Request, false);
            var now       = DateTimeOffset.Now;

            validator.Validate(data);
            Assert.True(now <= validator.LastGetEntityTimestamp);
        }
Esempio n. 9
0
        public void TestError()
        {
            var data     = LoadData("KomServer-Error.xml");
            var document = ExtraUtilities.Deserialize <ExtraErrorType>(data);

            Assert.NotNull(document);
            var validator = new GkvExtraValidator(ExtraMessageType.SupplyData, ExtraTransportDirection.Response, true);
            var now       = DateTimeOffset.Now;

            validator.Validate(data);
            Assert.True(now <= validator.LastGetEntityTimestamp);
        }
Esempio n. 10
0
        public void TestMessageResponseOnePackageRejected()
        {
            var data     = LoadData("KomServer-Meldung-Response-EinPaketAbgelehnt.xml");
            var document = ExtraUtilities.Deserialize <TransportResponseType>(data);

            Assert.NotNull(document);
            var validator = new GkvExtraValidator(ExtraMessageType.SupplyData, ExtraTransportDirection.Response, false);
            var now       = DateTimeOffset.Now;

            validator.Validate(data);
            Assert.True(now <= validator.LastGetEntityTimestamp);
        }
Esempio n. 11
0
        public void DeserializePluginCertificates14()
        {
            var certificates = ExtraUtilities.Deserialize <CertificatesType>(LoadData("plugin-certificates.xml"));

            Assert.NotNull(certificates);
            Assert.True(certificates.versionSpecified);
            Assert.Equal(CertificatesTypeVersion.Item10, certificates.version);
            Assert.NotNull(certificates.X509EncCertificate);
            Assert.Single(certificates.X509EncCertificate);
            var cert = certificates.X509EncCertificate[0];

            Assert.NotNull(cert);
            Assert.NotNull(cert.Value);
            Assert.Equal("b64value", Convert.ToBase64String(cert.Value));
        }
Esempio n. 12
0
        public void TestTransportRequestGkv14()
        {
            var transport = ExtraUtilities.Deserialize <TransportRequestType>(LoadData("extra-request-GKV-AGV_AS_20080407.xml"));

            Assert.Equal(SupportedVersionsType.Item13, transport.version);
            Assert.Equal("http://www.gkv.de/extra/profile/GKVAGV-AS/200804", transport.profile);

            var header = transport.TransportHeader;

            Assert.NotNull(header);
            Assert.Equal("http://www.extra-standard.de/test/NONE#1", header.TestIndicator);
            Assert.NotNull(header.Sender);
            Assert.NotNull(header.Sender.SenderID);
            Assert.Equal("BetriebsnummerSender", header.Sender.SenderID.Value);
            Assert.NotNull(header.Receiver);
            Assert.NotNull(header.Receiver.ReceiverID);
            Assert.Equal("BetriebsnummerEmpfaenger", header.Receiver.ReceiverID.Value);

            var requestDetails = header.RequestDetails;

            Assert.NotNull(requestDetails);
            Assert.NotNull(requestDetails.RequestID);
            Assert.Equal("RequestID012345", requestDetails.RequestID.Value);
            Assert.Equal("gkvagv-as", requestDetails.Procedure);
            Assert.Equal("req-res", requestDetails.DataType);
            Assert.Equal("http://www.extra-standard.de/scenario/request-with-response", requestDetails.Scenario);

            Assert.NotNull(transport.TransportBody);
            Assert.Collection(
                transport.TransportBody.Items,
                item =>
            {
                var data   = Assert.IsType <DataType1>(item);
                var anyXml = Assert.IsType <AnyXMLType>(data.Item);
                Assert.Collection(
                    anyXml.Items,
                    xmlItem =>
                {
                    Assert.Equal("RequestResult", xmlItem.Name.LocalName);
                });
            });
        }
Esempio n. 13
0
        public void DeserializeError()
        {
            var error = ExtraUtilities.Deserialize <ExtraErrorType>(_xmlData);

            Assert.NotNull(error);
            Assert.True(error.versionSpecified);
            Assert.Equal(SupportedVersionsType.Item11, error.version);
            Assert.NotNull(error.ResponseDetails);
            Assert.NotNull(error.ResponseDetails.ResponseID);
            Assert.Equal("String", error.ResponseDetails.ResponseID.@class);
            Assert.Equal("A(3794b25e-cafe-4dbe-872f-513c2e6d7ff8)", error.ResponseDetails.ResponseID.Value);
            Assert.Equal(new DateTime(2011, 1, 25, 12, 15, 57), error.ResponseDetails.TimeStamp);
            Assert.NotNull(error.ResponseDetails.Report);
            Assert.Equal(ExtraFlagWeight.Error, error.ResponseDetails.Report.highestWeight);
            Assert.NotNull(error.ResponseDetails.Report.Flag);
            Assert.Single(error.ResponseDetails.Report.Flag);
            Assert.Equal(ExtraFlagWeight.Error, error.ResponseDetails.Report.Flag[0].weight);
            Assert.Equal("E003", error.ResponseDetails.Report.Flag[0].Code.Value);
            Assert.Equal("Fehler in der eXTra-XML Struktur: Bei der XSD-Prüfung der gesendeten XML-Nachricht sind folgende Fehler aufgetreten:  # Zeile: 10 - Position: 5 - Das Element 'Receiver' in Namespace 'http://www.extra-standard.de/namespace/components/1' hat ein ungültiges untergeordnetes Element 'Name' in Namespace 'http://www.extra-standard.de/namespace/components/1'. Erwartet wurde die Liste möglicher Elemente: 'ReceiverID' in Namespace 'http://www.extra-standard.de/namespace/components/1'. ## FehlerCode: E003 ## Workflow-ID: A(3794b25e-5d4d-4dbe-872f-513c2e6d7ff8)", error.ResponseDetails.Report.Flag[0].Text.Value);
        }
Esempio n. 14
0
        public void DeserializePluginDataTransforms14()
        {
            var dataTransforms = ExtraUtilities.Deserialize <DataTransformsType>(LoadData("plugin.datatransforms.xml"));

            Assert.NotNull(dataTransforms);
            Assert.True(dataTransforms.versionSpecified);
            Assert.Equal(DataTransformsTypeVersion.Item12, dataTransforms.version);

            Assert.NotNull(dataTransforms.Compression);
            Assert.NotNull(dataTransforms.Encryption);
            Assert.NotNull(dataTransforms.Signature);

            Assert.Single(dataTransforms.Compression);
            Assert.Single(dataTransforms.Encryption);
            Assert.Single(dataTransforms.Signature);
            {
                var item = dataTransforms.Compression[0];
                Assert.NotNull(item);
                Assert.Equal("1", item.order);
                Assert.NotNull(item.InputData);
                Assert.Equal("6456734", item.InputData.bytes);
                Assert.NotNull(item.OutputData);
                Assert.Equal("345933", item.OutputData.bytes);
                Assert.NotNull(item.Algorithm);
                Assert.Equal("http://www.extra-standard.de/transforms/compression#GZIP", item.Algorithm.id);
                AbstractAlgorithmType algorithm = item.Algorithm;
                Assert.Equal("GZIP", algorithm.name);
                Assert.Equal(string.Empty, algorithm.version);
                var specification = algorithm.Specification;
                Assert.NotNull(specification);
                Assert.Equal("Security...", specification.name);
                Assert.Equal("http://my.domain.de/resource", specification.url);
                Assert.Equal("1.5.1", specification.version);
            }

            {
                var item = dataTransforms.Encryption[0];
                Assert.NotNull(item);
                Assert.Equal("2", item.order);
                Assert.NotNull(item.InputData);
                Assert.Equal("345933", item.InputData.bytes);
                Assert.NotNull(item.OutputData);
                Assert.Equal("386003", item.OutputData.bytes);
                Assert.NotNull(item.Algorithm);
                Assert.Equal("http://www.extra-standard.de/transforms/encryption/PKCS7", item.Algorithm.id);
                var algorithm = item.Algorithm;
                Assert.Equal("PKCS#7", algorithm.name);
                Assert.Equal("1.5", algorithm.version);
                var specification = algorithm.Specification;
                Assert.NotNull(specification);
                Assert.Equal("Security...", specification.name);
                Assert.Equal("http://my.domain.de/resource", specification.url);
                Assert.Equal("1.5.1", specification.version);
            }

            {
                var item = dataTransforms.Signature[0];
                Assert.NotNull(item);
                Assert.Equal("3", item.order);
                Assert.NotNull(item.X509Certificate);
                Assert.NotNull(item.X509Certificate.Value);
                Assert.Equal("b64value", Convert.ToBase64String(item.X509Certificate.Value));
                Assert.NotNull(item.Algorithm);
                Assert.Equal("http://www.extra-standard.de/transforms/encryption/PKCS7", item.Algorithm.id);
                var algorithm = item.Algorithm;
                Assert.Equal("PKCS#7", algorithm.name);
                Assert.Equal("1.5", algorithm.version);
                var specification = algorithm.Specification;
                Assert.NotNull(specification);
                Assert.Equal("Security...", specification.name);
                Assert.Equal("http://my.domain.de/resource", specification.url);
                Assert.Equal("1.5.1", specification.version);
            }
        }
Esempio n. 15
0
        public void TestTransportRequest14()
        {
            var transport = ExtraUtilities.Deserialize <TransportRequestType>(LoadData("extra-request-050-20070606.xml"));

            Assert.Equal(SupportedVersionsType.Item13, transport.version);
            Assert.Equal("http://www.extra-standard.de/profile/TESTPROFILE/1", transport.profile);

            var header = transport.TransportHeader;

            Assert.NotNull(header);
            Assert.Equal("http://www.extra-standard.de/test/NONE", header.TestIndicator);
            Assert.NotNull(header.Sender);
            Assert.NotNull(header.Sender.SenderID);
            Assert.Null(header.Sender.SenderID.Value);
            Assert.NotNull(header.Receiver);
            Assert.NotNull(header.Receiver.ReceiverID);
            Assert.Null(header.Receiver.ReceiverID.Value);
            Assert.NotNull(header.RequestDetails);
            Assert.NotNull(header.RequestDetails.RequestID);
            Assert.Equal("1111111", header.RequestDetails.RequestID.Value);

            var body = transport.TransportBody;

            Assert.NotNull(body);
            Assert.NotNull(body.Items);
            Assert.Single(body.Items);

            var bodyData = Assert.IsType <DataType1>(body.Items[0]);

            var anyXmlData = Assert.IsType <AnyXMLType>(bodyData.Item);

            Assert.NotNull(anyXmlData.Text);
            Assert.Single(anyXmlData.Text);
            Assert.Equal("test data", anyXmlData.Text[0]);
            Assert.Null(anyXmlData.Items);

            var logging = transport.Logging;

            Assert.NotNull(logging);
            Assert.Equal(LoggingVersionType.Item10, logging.version);
            Assert.NotNull(logging.Items);
            Assert.Single(logging.Items);

            var logSequence = Assert.IsType <LogSequenceType>(logging.Items[0]);

            Assert.Equal(XmlConvert.ToDateTime("2007-06-06T00:00:01", XmlDateTimeSerializationMode.Local), logSequence.TimeStamp);
            Assert.Equal("CORE.KONVERT 1.5", logSequence.ComponentID);

            Assert.Collection(
                logSequence.Items,
                item =>
            {
                var evt = Assert.IsType <EventType>(item);
                Assert.True(evt.TimeStampSpecified);
                Assert.Equal(XmlConvert.ToDateTime("2007-06-06T00:00:01", XmlDateTimeSerializationMode.Local), evt.TimeStamp);
                Assert.Equal("CORE.SERVER", evt.ComponentID);
            },
                item =>
            {
                var state = Assert.IsType <StateType>(item);
                Assert.Equal(XmlConvert.ToDateTime("2007-06-06T00:00:01", XmlDateTimeSerializationMode.Local), state.TimeStamp);
                var prop = Assert.IsType <PropertyType>(state.Item);
                Assert.Equal("generated.documentid", prop.name);
                Assert.Equal(XSDPrefixedTypeCodes.xsstring, prop.type);
                Assert.Equal("12968438573722894", prop.Value);
            },
                item =>
            {
                var op = Assert.IsType <OperationType>(item);
                Assert.Equal("0", op.completionCode);
                Assert.True(op.successfulSpecified);
                Assert.True(op.successful);
                Assert.Equal("http://www.extra-standard.de/operation/VALIDATE_XML", op.id);
                Assert.Equal("Validierung Transferobjekt", op.description);
                Assert.Collection(
                    op.Items,
                    opItem =>
                {
                    var param = Assert.IsType <ParameterType>(opItem);
                    Assert.Equal("http://www.extra.standard.de/class/SCHEMA", param.@class);
                    Assert.Equal("http://www.extra-standard.de/usage/IN", param.usage);
                    Assert.Equal("XSD Schema", param.description);
                    Assert.Equal("file://...", param.Value);
                });
            },
                item =>
            {
                var op = Assert.IsType <OperationType>(item);
                Assert.Equal("0", op.completionCode);
                Assert.True(op.successfulSpecified);
                Assert.True(op.successful);
                Assert.Equal("http://www.extra-standard.de/operation/DECRYPT", op.id);
                Assert.Equal("Entschluesselung", op.description);
                Assert.Collection(
                    op.Items,
                    opItem =>
                {
                    var obj = Assert.IsType <ObjectType1>(opItem);
                    Assert.Equal("http://www.extra.standard.de/class/XML_CONTENT", obj.@class);
                    Assert.Equal("XMLTransport/TransferBody", obj.location);
                });
            },
                item =>
            {
                var op = Assert.IsType <OperationType>(item);
                Assert.Equal("12", op.completionCode);
                Assert.True(op.successfulSpecified);
                Assert.False(op.successful);
                Assert.Equal("http://www.destatis.de/operation/VALIDATE", op.id);
                Assert.Equal("Pruefung der Rohdaten", op.description);
                Assert.Equal("CORE.INSPECTOR 1.5", op.ComponentID);
                Assert.Collection(
                    op.Items,
                    opItem =>
                {
                    var exc = Assert.IsType <ExceptionType>(opItem);
                    Assert.Equal(XmlConvert.ToDateTime("2007-06-06T00:00:01", XmlDateTimeSerializationMode.Local), exc.TimeStamp);
                    Assert.Collection(
                        exc.Items,
                        excItem =>
                    {
                        var msg = Assert.IsType <MessageType>(excItem);
                        Assert.Equal(XmlConvert.ToDateTime("2007-06-06T00:00:01", XmlDateTimeSerializationMode.Local), msg.TimeStamp);
                        Assert.NotNull(msg.Text);
                        Assert.Equal("Invalid data", msg.Text.Value);
                    });
                });
            });
        }