public void DataPublishError() { ShapesConfigMockService shapesConfigMockService = new ShapesConfigMockService(); RepositoriesConfigMockService repositoriesConfigMockService = new RepositoriesConfigMockService(); ConfigSparql configSparql = new ConfigSparql(); configSparql.Endpoint = ""; etlController etlController = new etlController(repositoriesConfigMockService, shapesConfigMockService, configSparql); try { var response = etlController.dataPublish(null); if (response is BadRequestObjectResult) { Assert.True(true); } else { Assert.True(false); } } catch (Exception) { Assert.True(true); } }
public void DataPublish() { 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"); etlController.dataPublish(file); Assert.True(true); }