Beispiel #1
0
        public void DataValidateValidationFileKO()
        {
            etlController etlController = new etlController(null, null, null, null, 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");

            var stream2 = new MemoryStream();
            var writer2 = new StreamWriter(stream2);

            writer2.Write(validationFileKO);
            writer2.Flush();
            stream2.Position = 0;
            var         file2  = new FormFile(stream2, 0, stream2.Length, null, "validationKO.xml");
            ShapeReport report = (ShapeReport)((OkObjectResult)etlController.dataValidate(file, file2)).Value;

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

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

            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);
            }
        }
        public IActionResult ExampleError()
        {
            etlController etlController = new etlController(null, null, null, 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");

            var stream2 = new MemoryStream();
            var writer2 = new StreamWriter(stream2);

            writer2.Write(validationFileKO);
            writer2.Flush();
            stream2.Position = 0;
            var         file2  = new FormFile(stream2, 0, stream2.Length, null, "validationKO.xml");
            ShapeReport report = (ShapeReport)((OkObjectResult)etlController.dataValidate(file, file2)).Value;

            return(Ok());
        }