Exemple #1
0
        public async Task RebuildCacheIfNotCurrentScansAll()
        {
            var engineEnvironmentSettings = helper.CreateEnvironment();

            var nupkgFolder    = GetNupkgsFolder();
            var nupkgsWildcard = new[] { Path.Combine(nupkgFolder, "*.nupkg") };

            FakeFactory.SetNuPkgsAndFolders(nupkgsWildcard);
            engineEnvironmentSettings.SettingsLoader.Components.Register(typeof(FakeFactory));
            await engineEnvironmentSettings.SettingsLoader.GetTemplatesAsync(default).ConfigureAwait(false);
        public async Task OrderOfScanningIsCorrect()
        {
            var engineEnvironmentSettings = _environmentSettingsHelper.CreateEnvironment();
            var workingDir = TestUtils.CreateTemporaryFolder("workingDir");
            var folders    = new List <string>();

            for (int i = 0; i < 100; i++)
            {
                var folderPath = Path.Combine(workingDir, $"Folder{i}");
                folders.Add(folderPath);
                engineEnvironmentSettings.Host.FileSystem.CreateDirectory(Path.Combine(folderPath, ".template.config"));
                engineEnvironmentSettings.Host.FileSystem.WriteAllText(
                    Path.Combine(folderPath, ".template.config", "template.json"),
                    $"{{ \"identity\": \"AllHaveSameIdentity\", \"shortName\": \"sample{i}\", \"name\": \"sample name {i}\"}}");
            }

            FakeFactory.SetNuPkgsAndFolders(folders: folders);
            engineEnvironmentSettings.Components.AddComponent(typeof(ITemplatePackageProviderFactory), new FakeFactory());
            var templates = await new TemplatePackageManager(engineEnvironmentSettings).GetTemplatesAsync(default)