Пример #1
0
        public void Casing_of_property_path_is_irrelevant_to_result()
        {
            // Arrange
            var sut      = new MetadataDataAccess();
            var jsonText = File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, "dateiTestData.json"), Encoding.UTF8);
            var data     = new List <ICmisExtensionElement>
            {
                JsonConvert.DeserializeObject <CmisExtensionElement>(jsonText, new JsonSerializerSettings
                {
                    Converters       = { new ExtensionElementConverter() },
                    TypeNameHandling = TypeNameHandling.Auto
                })
            };

            // Act
            var value  = sut.GetExtendedPropertyValue(data, "Arelda:datei/datei/originalName");
            var value2 = sut.GetExtendedPropertyValue(data, "ArElDa:daTei/dAtei/ORIGINALNAME");

            // Assert
            value.Should().Be("README.txt");
            value.Should().Be(value2);
        }
Пример #2
0
        public void Get_inexisting_simple_matadata_property_returns_null_or_empty()
        {
            // Arrange
            var sut      = new MetadataDataAccess();
            var jsonText = File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, "dateiTestData.json"), Encoding.UTF8);
            var data     = new List <ICmisExtensionElement>
            {
                JsonConvert.DeserializeObject <CmisExtensionElement>(jsonText, new JsonSerializerSettings
                {
                    Converters       = { new ExtensionElementConverter() },
                    TypeNameHandling = TypeNameHandling.Auto
                })
            };

            // Act
            var value = sut.GetExtendedPropertyValue(data, "Inexisting property");

            // Assert
            value.Should().BeNullOrEmpty();
        }
Пример #3
0
        public void Get_nested_matadata_property_with_attribute_must_return_correct_value()
        {
            // Arrange
            var sut      = new MetadataDataAccess();
            var jsonText = File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, "dateiTestData.json"), Encoding.UTF8);
            var data     = new List <ICmisExtensionElement>
            {
                JsonConvert.DeserializeObject <CmisExtensionElement>(jsonText, new JsonSerializerSettings
                {
                    Converters       = { new ExtensionElementConverter() },
                    TypeNameHandling = TypeNameHandling.Auto
                })
            };

            // Act
            var value = sut.GetExtendedPropertyValue(data, "ARELDA:datei/datei@id");

            // Assert
            value.Should().Be("_9ddrsOngEeW0aqy2QDXP4A");
        }
Пример #4
0
        public void Get_simple_matadata_property_must_return_correct_value()
        {
            // Arrange
            var sut      = new MetadataDataAccess();
            var jsonText = File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, "dateiTestData.json"), Encoding.UTF8);
            var data     = new List <ICmisExtensionElement>
            {
                JsonConvert.DeserializeObject <CmisExtensionElement>(jsonText, new JsonSerializerSettings
                {
                    Converters       = { new ExtensionElementConverter() },
                    TypeNameHandling = TypeNameHandling.Auto
                })
            };

            // Act
            var value = sut.GetExtendedPropertyValue(data, "Fixity Value");

            // Assert
            value.Should().Be("83ede739c7a1560b56b18d21db72b2fa");
        }