示例#1
0
 public void _04_GetNonExistingDocumentTypeFromIdTest()
 {
     try
     {
         Print.Started("_04_GetNonExistingDocumentTypeFromIdTest");
         string rootName      = "Test";
         string rootNamespace = "http://oio.dk/test";
         XPathDiscriminatorConfig           identifierDiscriminatorA = new XPathDiscriminatorConfig("//Test/Key", "A");
         XPathDiscriminatorConfig           identifierDiscriminatorB = new XPathDiscriminatorConfig("//Test/Key", "B");
         XpathDiscriminatorConfigCollection identifierDiscriminators = new XpathDiscriminatorConfigCollection();
         identifierDiscriminators.Add(identifierDiscriminatorA);
         identifierDiscriminators.Add(identifierDiscriminatorB);
         DocumentTypeConfig           documentType           = new DocumentTypeConfig(rootName, rootNamespace, identifierDiscriminators);
         DocumentTypeCollectionConfig documentTypeCollection = new DocumentTypeCollectionConfig();
         documentTypeCollection.AddDocumentType(documentType);
         DocumentTypeConfig documentTypeFromCollection = null;
         bool any = documentTypeCollection.TryGetDocumentType(Guid.NewGuid(), out documentTypeFromCollection);
         Assert.IsFalse(any);
         Assert.IsNull(documentTypeFromCollection);
     }
     finally
     {
         Print.Completed("_04_GetNonExistingDocumentTypeFromIdTest");
     }
 }
示例#2
0
 public void _01_AddRemoveDocumentTypeTest()
 {
     try
     {
         Print.Started("_01_AddRemoveDocumentTypeTest");
         string rootName      = "Test";
         string rootNamespace = "http://oio.dk/test";
         XPathDiscriminatorConfig           identifierDiscriminatorA = new XPathDiscriminatorConfig("//Test/Key", "A");
         XPathDiscriminatorConfig           identifierDiscriminatorB = new XPathDiscriminatorConfig("//Test/Key", "B");
         XpathDiscriminatorConfigCollection identifierDiscriminators = new XpathDiscriminatorConfigCollection();
         identifierDiscriminators.Add(identifierDiscriminatorA);
         identifierDiscriminators.Add(identifierDiscriminatorB);
         DocumentTypeConfig           documentType           = new DocumentTypeConfig(rootName, rootNamespace, identifierDiscriminators);
         DocumentTypeCollectionConfig documentTypeCollection = new DocumentTypeCollectionConfig();
         documentTypeCollection.AddDocumentType(documentType);
         DocumentTypeConfig documentTypeFromCollection = documentTypeCollection.GetDocumentType(rootName, rootNamespace, identifierDiscriminators);
         Assert.IsTrue(documentTypeFromCollection.Equals(documentType));
         documentTypeCollection.RemoveDocumentType(documentTypeFromCollection);
         documentTypeFromCollection = null;
         bool anyDocument = documentTypeCollection.TryGetDocumentType(rootName, rootNamespace, identifierDiscriminators, out documentTypeFromCollection);
         Assert.IsFalse(anyDocument);
     }
     catch (Exception)
     {
         // easy debug
     }
     finally
     {
         Print.Completed("_01_AddRemoveDocumentTypeTest");
     }
 }