コード例 #1
0
ファイル: TestITI41.cs プロジェクト: codeape2/XDSDotNet
        public void TestGeneratedXml()
        {
            var pards = new ProvideAndRegisterDocumentSet_ITI41("pid", "sid", "Et dokument", "text/plain", new byte[] { 1, 2, 3 });

            pards.AddSubmissionSetClassification(new XDSClassification {
                ClassificationScheme = "CS", CodingScheme = "CoS", NodeRepresentation = "NR", Name = "N"
            });
            pards.AddDocumentClassification(new XDSClassification {
                ClassificationScheme = "CS2", CodingScheme = "CoS2", NodeRepresentation = "NR2", Name = "N2"
            });
            var request = pards.CreateRequestBody();

            var externalIdentifiers = request.Descendants(XMLNamespaces.rim + "ExternalIdentifier");

            Assert.Equal(5, externalIdentifiers.Count());

            var classifications = request.Descendants(XMLNamespaces.rim + "Classification");

            Assert.Equal(2 + 1, classifications.Count());
        }
コード例 #2
0
ファイル: TestITI41.cs プロジェクト: codeape2/XDSDotNet
        public void TestGeneratedXmlEquals()
        {
            var pards = new ProvideAndRegisterDocumentSet_ITI41("pid", "sid", "Et dokument", "text/plain", new byte[] { 1, 2, 3 });

            pards.AddSubmissionSetClassification(new XDSClassification {
                ClassificationScheme = "CS", CodingScheme = "CoS", NodeRepresentation = "NR", Name = "N"
            });
            pards.AddDocumentClassification(new XDSClassification {
                ClassificationScheme = "CS2", CodingScheme = "CoS2", NodeRepresentation = "NR2", Name = "N2"
            });
            pards.AddDocumentSlot(new XDSSlot {
                Name = "SName", Value = "SValue"
            });

            pards.DocumentId      = "docid";
            pards.SubmissionSetId = "ssid";
            pards.SubmissionTime  = new DateTime(2016, 1, 1);
            var request = pards.CreateRequestBody();

            Assert.Equal(File.ReadAllText("iti41_baseline.xml"), request.ToString());
        }