コード例 #1
0
        private void ValidateRtvslib1Installed(IReadOnlyList <RPackage> pkgs, string libPath)
        {
            var rtvslib1Expected = TestPackages.CreateRtvsLib1();

            rtvslib1Expected.LibPath          = libPath.ToRPath();
            rtvslib1Expected.NeedsCompilation = null;

            var rtvslib1Actual = pkgs.Should().ContainSingle(pkg => pkg.Package == TestPackages.RtvsLib1Description.Package && pkg.LibPath == libPath.ToRPath()).Which;

            rtvslib1Actual.ShouldBeEquivalentTo(rtvslib1Expected);
        }
コード例 #2
0
        public async Task AvailablePackagesLocalRepo()
        {
            await TestRepositories.SetLocalRepoAsync(_workflow.RSession, _repoPath);

            var result = await _workflow.Packages.GetAvailablePackagesAsync();

            result.Should().HaveCount(3);

            var rtvslib1Expected = TestPackages.CreateRtvsLib1();

            rtvslib1Expected.Title       = null;
            rtvslib1Expected.Built       = null;
            rtvslib1Expected.Author      = null;
            rtvslib1Expected.Description = null;
            rtvslib1Expected.Repository  = $"file:///{_repoPath.ToRPath()}/src/contrib";

            var rtvslib1Actual = result.SingleOrDefault(pkg => pkg.Package == TestPackages.RtvsLib1Description.Package);

            rtvslib1Actual.ShouldBeEquivalentTo(rtvslib1Expected);
        }
コード例 #3
0
        public async Task DefaultActionAsync()
        {
            var package = TestPackages.CreateRtvsLib1().Package;

            await InUI(() => _packageManagerViewModel.SwitchToAvailablePackagesAsync());
            await InUI(() => _packageManagerViewModel.SelectPackage(_packageManagerViewModel.Items.OfType <IRPackageViewModel>().SingleOrDefault(p => p.Name == package)));

            _packageManagerViewModel.SelectedPackage.Should().NotBeNull();
            _packageManagerViewModel.SelectedPackage.IsInstalled.Should().BeFalse();
            _packageManagerViewModel.SelectedPackage.IsLoaded.Should().BeFalse();

            await InUI(() => _packageManagerViewModel.DefaultActionAsync());

            _packageManagerViewModel.SelectedPackage.Should().NotBeNull();
            _packageManagerViewModel.SelectedPackage.IsInstalled.Should().BeTrue();
            _packageManagerViewModel.SelectedPackage.IsLoaded.Should().BeFalse();

            await InUI(() => _packageManagerViewModel.DefaultActionAsync());

            _packageManagerViewModel.SelectedPackage.Should().NotBeNull();
            _packageManagerViewModel.SelectedPackage.IsInstalled.Should().BeTrue();
            _packageManagerViewModel.SelectedPackage.IsLoaded.Should().BeTrue();
        }