static MockScriptureProvider() { MockScriptureProvider provider = new MockScriptureProvider(); AggregateCatalog catalog = new AggregateCatalog(); var exePath = Path.Combine(Path.GetDirectoryName(FwDirectoryFinder.FlexExe)); catalog.Catalogs.Add(new DirectoryCatalog(exePath, "Paratext8Plugin.dll")); using (CompositionContainer container = new CompositionContainer(catalog)) { container.SatisfyImportsOnce(provider); } _provider = provider._potentialScriptureProvider; }
public void ParatextCanInitialize() { try { MockScriptureProvider.Initialize(); } catch (Exception e) { // A TypeInitializationException may also be thrown if ParaText 8 is not installed. Assert.False(MockScriptureProvider.IsInstalled); // A FileLoadException may indicate that ParatextData dependency (i.e. icu.net) has been undated to a new version. Assert.False(e.GetType().Name.Contains(typeof(FileLoadException).Name)); } }