public async void CompilationService_TestGistCompilation() { var gist = ScriptTestDataHelper.GetGist(); var metadata = new EntityMetadata(gist, EntityType.Gist); var scriptOptions = ScriptTestDataHelper.GetScriptOption(ScriptHelper.GetFrameworkReferences(), ScriptHelper.GetFrameworkImports()); var serviceInstance = CompilationServiceFactory.CreateService(metadata, scriptOptions); var compilation = await serviceInstance.GetCompilationAsync(); var diagnostics = await compilation.GetDiagnosticsAsync(); Assert.Empty(diagnostics.Select(d => d.Severity == DiagnosticSeverity.Error)); }
public async void EntityInvoker_TestDetectorWithGists() { var gist = ScriptTestDataHelper.GetGist(); var references = new Dictionary <string, string> { { "xxx", gist }, { "yyy", "" }, { "zzz", "" } }; var metadata = new EntityMetadata(ScriptTestDataHelper.GetSentinel(), EntityType.Detector); using (EntityInvoker invoker = new EntityInvoker(metadata, ScriptHelper.GetFrameworkReferences(), ScriptHelper.GetFrameworkImports(), references.ToImmutableDictionary())) { await invoker.InitializeEntryPointAsync(); var result = (string)await invoker.Invoke(new object[] { }); Assert.Equal(2, invoker.References.Count()); Assert.False(string.IsNullOrWhiteSpace(result)); } }