public static async Task ClassInitialize(TestContext context) { // Setup IServiceCollection services = new ServiceCollection(); IConfiguration configuration = new ConfigurationBuilder().Build(); services.AddSingleton(configuration); services.AddBotRuntime(configuration); var parent = Environment.CurrentDirectory; while (!string.IsNullOrEmpty(parent)) { if (System.IO.Directory.EnumerateFiles(parent, "*proj").Any()) { break; } else { parent = System.IO.Path.GetDirectoryName(parent); } } ResourceExplorer = new ResourceExplorer(); ResourceExplorer.AddResourceType("yaml"); ResourceExplorer.AddFolder(parent, monitorChanges: false); }
public static void ClassInitialize(TestContext context) { ComponentRegistration.Add(new DeclarativeComponentRegistration()); ComponentRegistration.Add(new DialogsComponentRegistration()); ComponentRegistration.Add(new AdaptiveComponentRegistration()); ComponentRegistration.Add(new LanguageGenerationComponentRegistration()); ComponentRegistration.Add(new DeclarativeComponentRegistrationBridge <LucyBotComponent>()); ResourceExplorer = new ResourceExplorer() .AddFolder(@"..\..\..\TestBot"); ResourceExplorer.AddResourceType("yaml"); }
/// <summary> /// Find all foo.function.js resources and mount as expression functions /// </summary> /// <param name="resourceExplorer"></param> /// <returns></returns> public static void AddJavascriptFunctions(ResourceExplorer resourceExplorer) { resourceExplorer.AddResourceType("js"); foreach (var resource in resourceExplorer.GetResources("js").Where(res => res.Id.EndsWith(".function.js"))) { AddFunctions(resource); } resourceExplorer.Changed -= ResourceExplorer_Changed; resourceExplorer.Changed += ResourceExplorer_Changed; }