public CodeAnalysisTests() { Assembly.Load("Rhetos.Dsl.DefaultConcepts"); serviceProvider = TestCommon.CreateTestServiceProvider(); serviceProvider.GetService <RhetosAppContext>().InitializeFromCurrentDomain(); rhetosDocumentFactory = serviceProvider.GetService <RhetosDocumentFactory>(); }
public static RhetosDocument CreateWithTestUri(this RhetosDocumentFactory rhetosDocumentFactory, string text = null, LineChr?showPosition = null) { var rhetosDocument = rhetosDocumentFactory.CreateNew(new Uri($"file://\\{Guid.NewGuid()}")); if (text != null) { rhetosDocument.UpdateText(text); Console.WriteLine($"Initialized document: {rhetosDocument.DocumentUri} with text:\n{text}<< END DOCUMENT >>\n\n"); } if (showPosition != null) { var positionText = rhetosDocument.TextDocument.ShowPosition(showPosition.Value); Console.WriteLine($"\n{positionText}\n"); } return(rhetosDocument); }
public RhetosDocumentTests() { serviceProvider = TestCommon.CreateTestServiceProvider("./"); rhetosDocumentFactory = serviceProvider.GetRequiredService <RhetosDocumentFactory>(); }
public CodeAnalysisTests() { serviceProvider = TestCommon.CreateTestServiceProvider("./"); rhetosDocumentFactory = serviceProvider.GetService <RhetosDocumentFactory>(); }