Esempio n. 1
0
 public ControlTestHelper(bool debug = true, Action <DotvvmConfiguration> config = null, Action <IServiceCollection> services = null)
 {
     fileLoader         = new FakeMarkupFileLoader(null);
     this.configuration = DotvvmTestHelper.CreateConfiguration(s => {
         s.AddSingleton <IMarkupFileLoader>(fileLoader);
         services?.Invoke(s);
     });
     this.configuration.Markup.AddCodeControls("tc", exampleControl: typeof(FakeHeadResourceLink));
     this.configuration.ApplicationPhysicalPath = Path.GetTempPath();
     this.configuration.Debug = debug;
     config?.Invoke(this.configuration);
     presenter = (DotvvmPresenter)this.configuration.ServiceProvider.GetRequiredService <IDotvvmPresenter>();
 }
 /// <summary>
 /// Gets the unique id of the SpaContentPlaceHolder that should be loaded.
 /// </summary>
 public static string GetSpaContentPlaceHolderUniqueId(this IDotvvmRequestContext context)
 {
     return(DotvvmPresenter.DetermineSpaContentPlaceHolderUniqueId(context.HttpContext));
 }