Example #1
0
        public void UpdateDefaultVocabulary_ElementWithVocab_UpdatesContextDefaultVocabulary()
        {
            // Arrange
            var parser = new RDFaParser();
            var context = _testContext.GetParserContext();
            var element = _testContext.GetElement("Resource\\alice-example.html", "//body");

            // Act
            var result = parser.UpdateDefaultVocabulary(context, element);

            // Assert
            Assert.AreEqual("http://purl.org/dc/terms/", result);
        }
Example #2
0
        public void UpdateDefaultVocabulary_ElementAndAnsestorsDoesNotHaveVocab_ReturnNull()
        {
            // Arrange
            var parser = new RDFaParser();
            var context = _testContext.GetParserContext();
            context.DefaultVocabulary = "http://purl.org/dc/terms/";
            var element = _testContext.GetElement("Resource\\alice-example.html", "//head");

            // Act
            var result = parser.UpdateDefaultVocabulary(context, element);

            // Assert
            Assert.IsNull(result);
        }