Inheritance: IPackageIndex
Example #1
0
        public async Task BuildPackageIndexTest() {
            string[] packageNames = {
                "base",
                "boot",
                "class",
                "cluster",
                "codetools",
                "compiler",
                "datasets",
                "foreign",
                "graphics",
                "grDevices",
                "grid",
                "KernSmooth",
                "lattice",
                "MASS",
                "Matrix",
                "methods",
                "mgcv",
                "nlme",
                "nnet",
                "parallel",
                "rpart",
                "spatial",
                "splines",
                "stats",
                "stats4",
                "survival",
                "tcltk",
                "tools",
                "translations",
                "utils",
             };

            IPackageIndex packageIndex;
            using (var host = new IntelliSenseRSession(_shell, _workflowProvider)) {
                await host.CreateSessionAsync();
                var functionIndex = new FunctionIndex(_shell, null, host);
                packageIndex = new PackageIndex(_workflowProvider, _shell, host, functionIndex);
                await packageIndex.BuildIndexAsync();
            }

            foreach (var name in packageNames) {
                IPackageInfo pi = await packageIndex.GetPackageInfoAsync(name);
                pi.Should().NotBeNull();
                pi.Name.Should().Be(name);
            }
        }
Example #2
0
 public async Task PackageDescriptionTest() {
     RToolsSettings.Current = new TestRToolsSettings();
     PackageIndex packageIndex;
     using (var host = new IntelliSenseRSession(_shell, _workflowProvider)) {
         await host.CreateSessionAsync();
         var functionIndex = new FunctionIndex(_shell, null, host);
         packageIndex = new PackageIndex(_workflowProvider, _shell, host, functionIndex);
         await packageIndex.BuildIndexAsync();
     }
     IPackageInfo pi = await packageIndex.GetPackageInfoAsync("base");
     pi.Description.Should().Be("Base R functions.");
 }