Browse Source
Can now run searches for NuGet packages using 'id', 'tags' and 'description' on repositories that support this feature such as the main NuGet feed. Example searches: id:nunit tags:typescript description:typescriptpull/403/head
10 changed files with 131 additions and 33 deletions
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Runtime.Versioning; |
||||
using ICSharpCode.PackageManagement.Design; |
||||
using NuGet; |
||||
using Rhino.Mocks; |
||||
|
||||
namespace PackageManagement.Tests.Helpers |
||||
{ |
||||
public class FakeServiceBasedRepository : FakePackageRepository, IServiceBasedRepository |
||||
{ |
||||
public IServiceBasedRepository Repository = MockRepository.GenerateStub<IServiceBasedRepository>(); |
||||
|
||||
public IQueryable<IPackage> Search(string searchTerm, IEnumerable<string> targetFrameworks, bool allowPrereleaseVersions) |
||||
{ |
||||
return Repository.Search(searchTerm, targetFrameworks, allowPrereleaseVersions); |
||||
} |
||||
|
||||
public void PackagesToReturnForSearch(string search, bool allowPrereleaseVersions, IEnumerable<IPackage> packages) |
||||
{ |
||||
Repository |
||||
.Stub(repo => repo.Search(search, new string[0], allowPrereleaseVersions)) |
||||
.Return(packages.AsQueryable()); |
||||
} |
||||
|
||||
public IEnumerable<IPackage> GetUpdates(IEnumerable<IPackageName> packages, bool includePrerelease, bool includeAllVersions, IEnumerable<FrameworkName> targetFrameworks, IEnumerable<IVersionSpec> versionConstraints) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue