void CreateUpdatedPackages()
        {
            sourceRepository
            .Stub(repository => repository.GetPackages())
            .Return(sourceRepositoryPackages.AsQueryable());

            sourceRepository
            .Stub(repository => repository.GetUpdates(
                      Arg <IEnumerable <IPackage> > .Is.Anything,
                      Arg <bool> .Is.Anything,
                      Arg <bool> .Is.Anything,
                      Arg <IEnumerable <FrameworkName> > .Is.Anything,
                      Arg <IEnumerable <IVersionSpec> > .Is.Anything))
            .WhenCalled(call => {
                includePreleaseUsedWhenCheckingForUpdates = (bool)call.Arguments[1];
                packagesUsedWhenCheckingForUpdates.AddRange(call.Arguments[0] as IEnumerable <IPackage>);
            })
            .Return(sourceRepositoryPackages.AsQueryable());

            updatedPackages = new UpdatedPackages(installedPackages.AsQueryable(), sourceRepository);
        }
Exemplo n.º 2
0
 public void PackagesToReturnForSearch(string search, bool allowPrereleaseVersions, IEnumerable <IPackage> packages)
 {
     Repository
     .Stub(repo => repo.Search(search, new string[0], allowPrereleaseVersions))
     .Return(packages.AsQueryable());
 }