void CreatePackageManager(IProject project, PackageReferenceRepositoryHelper packageRefRepositoryHelper)
		{
			options = new TestablePackageManagementOptions();
			options.PackagesDirectory = "packages";
			
			repositoryPaths = new SolutionPackageRepositoryPath(project, options);
			var pathResolver = new DefaultPackagePathResolver(repositoryPaths.PackageRepositoryPath);
			
			fakeFileSystem = new FakeFileSystem();
			
			fakeFeedSourceRepository = new FakePackageRepository();
			fakeSolutionSharedRepository = packageRefRepositoryHelper.FakeSharedSourceRepository;
			
			fakePackageOperationResolverFactory = new FakePackageOperationResolverFactory();
			
			var fakeSolutionPackageRepository = new FakeSolutionPackageRepository();
			fakeSolutionPackageRepository.FileSystem = fakeFileSystem;
			fakeSolutionPackageRepository.PackagePathResolver = pathResolver;
			fakeSolutionPackageRepository.FakeSharedRepository = fakeSolutionSharedRepository;
			
			packageManager = new SharpDevelopPackageManager(fakeFeedSourceRepository,
				packageRefRepositoryHelper.FakeProjectSystem,
				fakeSolutionPackageRepository,
				fakePackageOperationResolverFactory);
		}
		void CreatePackageReferenceRepository()
		{
			helper = new PackageReferenceRepositoryHelper();
			fakeFileSystem = helper.FakeProjectSystem;
			sourceRepository = helper.FakeSharedSourceRepository;
			repository = new PackageReferenceRepository(fakeFileSystem, sourceRepository);
		}
 void CreatePackageReferenceRepository(string path)
 {
     helper = new PackageReferenceRepositoryHelper();
     fakeFileSystem = helper.FakeProjectSystem;
     fakeFileSystem.PathToReturnFromGetFullPath = path;
     sourceRepository = helper.FakeSharedSourceRepository;
     repository = new PackageReferenceRepository(fakeFileSystem, helper.FakeProjectSystem.ProjectName, sourceRepository);
 }
		public void CreatedSharedRepository_FileSystemPassed_FileSystemUsedToCreatedSharedRepository()
		{
			CreateCache();
			FakeFileSystem fileSystem = new FakeFileSystem();
			FakeSharedPackageRepository repository = cache.CreateSharedRepository(null, fileSystem) as FakeSharedPackageRepository;
			
			Assert.AreEqual(fileSystem, repository.FileSystemPassedToConstructor);
		}
		void CreateScript()
		{
			fakeFileSystem = new FakeFileSystem();
			fakeFileSystem.FileExistsReturnValue = true;
			fakeFileSystem.DirectoryExistsReturnValue = true;
			scriptFileName = new PackageInstallScriptFileName(fakeFileSystem);
			
			fakeSession = new FakePackageScriptSession();
			fakePackage = new FakePackage();
			
			script = new PackageInstallScript(fakePackage, scriptFileName);
		}
		void CreatePackageManager(IProject project, PackageReferenceRepositoryHelper packageRefRepositoryHelper)
		{
			options = new PackageManagementOptions(new Properties());
			options.PackagesDirectory = "packages";
			
			repositoryPaths = new PackageRepositoryPaths(project, options);
			var pathResolver = new DefaultPackagePathResolver(repositoryPaths.SolutionPackagesPath);
			
			fakeFileSystem = new FakeFileSystem();
			
			fakeFeedSourceRepository = new FakePackageRepository();
			fakeSolutionSharedRepository = packageRefRepositoryHelper.FakeSharedSourceRepository;
			
			packageManager = new SharpDevelopPackageManager(fakeFeedSourceRepository,
				packageRefRepositoryHelper.FakeProjectSystem,
				fakeFileSystem,
				fakeSolutionSharedRepository,
				pathResolver);
		}
		void CreateFakeFileSystem()
		{
			fakeFileSystem = new FakeFileSystem();
		}
		public void CreatedSharedRepository_ConfigSettingsFileSystemPassed_FileSystemUsedToCreatedSharedRepository()
		{
			CreateCache();
			FakeFileSystem fileSystem = new FakeFileSystem();
			cache.CreateSharedRepository(null, null, fileSystem);
			
			Assert.AreEqual(fileSystem, fakePackageRepositoryFactory.ConfigSettingsFileSystemPassedToCreateSharedRepository);
		}
        public void ExtractPath_WrappedPackage_WrappedPackageExtractContentsCalled()
        {
            CreatePackage();
            var expectedFileSystem = new FakeFileSystem();
            string expectedPath = @"d:\projects\test\packages";

            package.ExtractContents(expectedFileSystem, expectedPath);

            Assert.AreEqual(expectedFileSystem, fakePackage.FileSystemPassedToExtractContents);
            Assert.AreEqual(expectedPath, fakePackage.ExtractPathPassedToExtractContents);
        }