public void AddSectionTest(string path, int count, string expectedPath) { XmlDocumentCollection collection = new XmlDocumentCollection("CNS1", "RNS1"); collection.AddSection(path, count); Assert.Multiple(() => { Assert.IsNotNull(collection.RelationshipSections); Assert.AreEqual(collection.RelationshipSections.Count, 1); Assert.AreEqual(collection.RelationshipSections[0].Path, expectedPath); }); }
public void AddSectionTest2(string path, int count, int expectedCount, string expectedPath) { XmlDocumentCollection collection = new XmlDocumentCollection("CNS1", "RNS1"); string[] paths = TestUtils.SplitValues(path, '|'); string[] expectedPaths = TestUtils.SplitValues(expectedPath, '|'); for(int i = 0; i < paths.Length; i++) { collection.AddSection(paths[i], count); } Assert.Multiple(() => { Assert.AreEqual(collection.RelationshipSections.Count, expectedCount); Assert.IsNotNull(collection.RelationshipSections); for (int i = 0; i < paths.Length; i++) { Assert.AreEqual(collection.RelationshipSections[i].Path, expectedPaths[i]); } }); }
public void ConstructorTest(string contentTypeXmlns, string relationshipXmlns, int estimatedContentTypeCount, int estimatedSectionCount, bool expectedRelationshipNsNull, string expectesRelationShipNs, string expectedContetType) { XmlDocumentCollection collection = new XmlDocumentCollection(contentTypeXmlns, relationshipXmlns, estimatedContentTypeCount, estimatedSectionCount); Assert.Multiple(() => { Assert.IsNotNull(collection); Assert.IsNotNull(collection.ContentTypes); Assert.AreEqual(collection.ContentTypes.GetXmlString(), expectedContetType); if (expectedRelationshipNsNull) { Assert.IsNull(collection.RelationshipXmlns); } else { Assert.IsNotNull(collection.RelationshipXmlns); Assert.AreEqual(collection.RelationshipXmlns, expectesRelationShipNs); } }); }