Beispiel #1
0
        public CodeAnalysisTests()
        {
            Assembly.Load("Rhetos.Dsl.DefaultConcepts");
            serviceProvider = TestCommon.CreateTestServiceProvider();

            serviceProvider.GetService <RhetosAppContext>().InitializeFromCurrentDomain();
            rhetosDocumentFactory = serviceProvider.GetService <RhetosDocumentFactory>();
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public RhetosDocumentTests()
 {
     serviceProvider       = TestCommon.CreateTestServiceProvider("./");
     rhetosDocumentFactory = serviceProvider.GetRequiredService <RhetosDocumentFactory>();
 }
Beispiel #4
0
 public CodeAnalysisTests()
 {
     serviceProvider       = TestCommon.CreateTestServiceProvider("./");
     rhetosDocumentFactory = serviceProvider.GetService <RhetosDocumentFactory>();
 }