Esempio n. 1
0
        public void ConstructorTest(string nameSpace, int estimatedElements, string expectedString)
        {
            XmlContentTypes types = new XmlContentTypes(nameSpace, estimatedElements);

            Assert.Multiple(() =>
            {
                Assert.IsNotNull(types);
                Assert.AreEqual(types.GetXmlString(), expectedString);
            });
        }
Esempio n. 2
0
        public void AddOverrideContentTypeTest(string contentType, string partName, string expectedString)
        {
            XmlContentTypes types = new XmlContentTypes("NS1");

            types.AddOverrideContentType(contentType, partName);
            Assert.Multiple(() =>
            {
                Assert.IsNotNull(types);
                Assert.AreEqual(types.GetXmlString(), expectedString);
            });
        }
Esempio n. 3
0
        public void AddDefaultContentTypeTest(string contentType, string extension, string expectedString)
        {
            XmlContentTypes types = new XmlContentTypes("NS1");

            types.AddDefaultContentType(contentType, extension);
            Assert.Multiple(() =>
            {
                Assert.IsNotNull(types);
                Assert.AreEqual(types.GetXmlString(), expectedString);
            });
        }
Esempio n. 4
0
        public void ConstructorTest(string path, string xmlns, string expectedPath, string expectedRelationship)
        {
            XmlContentTypes     reference = new XmlContentTypes("contentTypeNS");
            RelationshipSection section   = new RelationshipSection(path, xmlns, reference);

            Assert.Multiple(() => {
                Assert.IsNotNull(section.Documents);
                Assert.AreEqual(section.Documents.Count, 0);
                Assert.AreEqual(section.Relationships.GetXmlString(), expectedRelationship);
                Assert.AreEqual(section.Path, expectedPath);
            });
        }
Esempio n. 5
0
        public void AddDocumentTest(string xmlns, string id, string type, string targetPath, string contentType, string encoding, bool?standalone, string expectedDocumentString, string expectedRelationShipString)
        {
            XmlContentTypes     reference = new XmlContentTypes("contentTypeNS");
            RelationshipSection section   = new RelationshipSection("/path", xmlns, reference);

            section.AddDocument(id, type, targetPath, contentType, "/basePath", 10, encoding, standalone);
            Assert.Multiple(() =>
            {
                Assert.AreEqual(section.Documents.Count, 1);
                Assert.AreEqual(section.Documents[0].GetXmlString(), expectedDocumentString);
                Assert.AreEqual(section.Relationships.GetXmlString(), expectedRelationShipString);
            });
        }
Esempio n. 6
0
        public void AddDocumentTest2(string idString, string typeString, string targetPathString, int expectedCount, string expectedRelationShipString)
        {
            XmlContentTypes     reference = new XmlContentTypes("contentTypeNS");
            RelationshipSection section   = new RelationshipSection("/path", "ns1", reference);

            string[] ids         = TestUtils.SplitValues(idString, '|');
            string[] types       = TestUtils.SplitValues(typeString, '|');
            string[] targetPaths = TestUtils.SplitValues(targetPathString, '|');
            for (int i = 0; i < expectedCount; i++)
            {
                section.AddDocument(ids[i], types[i], targetPaths[i], "contentType", "/basePath", 10, "UTF-8", true);
            }
            Assert.Multiple(() =>
            {
                Assert.AreEqual(section.Documents.Count, expectedCount);
                Assert.AreEqual(section.Relationships.GetXmlString(), expectedRelationShipString);
            });
        }