Example #1
0
        public void DataValidate()
        {
            ShapesConfigMockService       shapesConfigMockService       = new ShapesConfigMockService();
            RepositoriesConfigMockService repositoriesConfigMockService = new RepositoriesConfigMockService();
            ConfigSparql configSparql = new ConfigSparql(null);

            configSparql.Endpoint = "";
            DiscoverItemMockService discoverItemService = new DiscoverItemMockService();
            etlController           etlController       = new etlController(discoverItemService, repositoriesConfigMockService, shapesConfigMockService, configSparql, null, null, null, null);

            var stream = new MemoryStream();
            var writer = new StreamWriter(stream);

            writer.Write(rdfFile);
            writer.Flush();
            stream.Position = 0;
            var         file   = new FormFile(stream, 0, stream.Length, null, "rdf.xml");
            ShapeReport report = (ShapeReport)((OkObjectResult)etlController.dataValidate(file, new Guid("390cde26-b39d-41c8-89e0-b87c207d8cf2"))).Value;

            if (!report.conforms && report.results.Count > 0)
            {
                Assert.True(true);
            }
            else
            {
                Assert.True(false);
            }
        }
Example #2
0
        public void GetOntology()
        {
            ShapesConfigMockService       shapesConfigMockService       = new ShapesConfigMockService();
            RepositoriesConfigMockService repositoriesConfigMockService = new RepositoriesConfigMockService();
            ConfigSparql configSparql = new ConfigSparql(null);

            configSparql.Endpoint = "";
            DiscoverItemMockService discoverItemService = new DiscoverItemMockService();
            etlController           etlController       = new etlController(discoverItemService, repositoriesConfigMockService, shapesConfigMockService, configSparql, null, null, null, null);

            etlController.GetOntology();
            Assert.True(true);
        }
Example #3
0
        public void GetHash()
        {
            ShapesConfigMockService       shapesConfigMockService       = new ShapesConfigMockService();
            RepositoriesConfigMockService repositoriesConfigMockService = new RepositoriesConfigMockService();
            ConfigSparql configSparql = new ConfigSparql(null);

            configSparql.Endpoint = "";
            DiscoverItemMockService discoverItemService = new DiscoverItemMockService();
            etlController           etlController       = new etlController(discoverItemService, repositoriesConfigMockService, shapesConfigMockService, configSparql, null, null, null, null);

            using (SHA256 sha256Hash = SHA256.Create())
            {
                string ontologyFile = File.ReadAllText("Config/Ontology/roh-v2.owl");
                var    response     = etlController.GetHash(sha256Hash, ontologyFile);
                if (response != null)
                {
                    Assert.True(true);
                }
            }
        }