public override bool Execute() { if (string.IsNullOrWhiteSpace(OutputLocation) == false) { Log.LogMessage($"OutputLocation: {OutputLocation}"); } Log.LogMessage($"Namespace: {Namespace}"); Log.LogMessage($"OntologyFilePath: {OntologyFilePath}"); bool result = true; try { CompilerResults compilerResults = ModelGenerator.CompileModelImplementationAssembly(OntologyFilePath, Namespace, OutputLocation, false); Log.LogMessage($"{Namespace} compiled with {compilerResults.Errors.Count} error(s)"); foreach (CompilerError error in compilerResults.Errors) { Log.LogError($"Error {error.ErrorNumber} ({error.Line},{error.Column}): {error.ErrorText}"); } result = compilerResults.Errors.HasErrors == false; } catch (Exception e) { Log.LogError(e.Message); result = false; } return(result); }
public void GenerateModelImplementationTest() { var result = ModelGenerator.CompileModelImplementationAssembly("Ontology.ttl", "Parliament.Model", System.IO.Path.GetTempPath()); Assert.IsFalse(result.Errors.HasErrors); }
public SerializationTest() { compilerResults = ModelGenerator.CompileModelImplementationAssembly("Ontology.ttl", "Parliament.Model", System.IO.Path.GetTempPath()); }