Пример #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(_coreShell, _workflowProvider)) {
                await host.StartSessionAsync();

                var functionIndex = new FunctionIndex(_coreShell, null, host);
                packageIndex = new PackageIndex(_workflowProvider, _coreShell, host, functionIndex);
                await packageIndex.BuildIndexAsync();
            }

            foreach (var name in packageNames)
            {
                IPackageInfo pi = await packageIndex.GetPackageInfoAsync(name);

                pi.Should().NotBeNull();
                pi.Name.Should().Be(name);
            }
        }
Пример #2
0
        public async Task PackageDescriptionTest()
        {
            PackageIndex packageIndex;

            using (var host = new IntelliSenseRSession(_coreShell, _workflowProvider)) {
                await host.StartSessionAsync();

                var functionIndex = new FunctionIndex(_coreShell, null, host);
                packageIndex = new PackageIndex(_workflowProvider, _coreShell, host, functionIndex);
                await packageIndex.BuildIndexAsync();
            }
            IPackageInfo pi = await packageIndex.GetPackageInfoAsync("base");

            pi.Description.Should().Be("Base R functions.");
        }