Пример #1
0
 // Methods
 public WebProjectManager(string remoteSource, string siteRoot)
 {
     string webRepositoryDirectory = GetWebRepositoryDirectory(siteRoot);
     var sourceRepository = PackageRepositoryFactory.Default.CreateRepository(remoteSource);
     var pathResolver = new DefaultPackagePathResolver(webRepositoryDirectory);
     var localRepository = PackageRepositoryFactory.Default.CreateRepository(webRepositoryDirectory);
     IProjectSystem project = new WebProjectSystem(siteRoot);
     _projectManager = new ProjectManager(sourceRepository, pathResolver, project, localRepository);
 }
        public void ResolvePathReturnsOriginalPathIfFileIsNotSource()
        {
            // Arrange
            var path = @"Foo.js";
            var webProjectSystem = new WebProjectSystem(@"x:\");

            // Act
            var resolvedPath = webProjectSystem.ResolvePath(path);

            // Assert
            Assert.Equal(path, resolvedPath);
        }
        public void ResolvePathReturnsAppCodePathIfPathIsSourceFile()
        {
            // Arrange
            var path = "Foo.cs";
            var webProjectSystem = new WebProjectSystem(@"x:\");

            // Act
            var resolvedPath = webProjectSystem.ResolvePath(path);

            // Assert
            Assert.Equal(@"App_Code\Foo.cs", resolvedPath);
        }
        public void ResolvePathReturnsOriginalPathIfSourceFilePathIsAlreadyUnderAppCode()
        {
            // Arrange
            var path = @"App_Code\Foo.cs";
            var webProjectSystem = new WebProjectSystem(@"x:\");

            // Act
            var resolvedPath = webProjectSystem.ResolvePath(path);

            // Assert
            Assert.Equal(path, resolvedPath);
        }
Пример #5
0
 public WebProjectManager(string remoteSource, string siteRoot)
 {
     string webRepositoryDirectory = GetWebRepositoryDirectory(siteRoot);
     Uri uri = new Uri(remoteSource);
     IPackageRepository repository = new DataServicePackageRepository(uri);//PackageRepositoryFactory.Default.CreateRepository(remoteSource);
     IPackagePathResolver resolver = new DefaultPackagePathResolver(webRepositoryDirectory);
     IPackageRepository repository2 = new LocalPackageRepository(webRepositoryDirectory, false); //PackageRepositoryFactory.Default.CreateRepository(webRepositoryDirectory);
     IProjectSystem system = new WebProjectSystem(siteRoot);
     ((DataServicePackageRepository)repository).ProgressAvailable += new EventHandler<ProgressEventArgs>(repository_ProgressAvailable);
     //((DataServicePackageRepository)repository).SendingRequest += new EventHandler<WebRequestEventArgs>(repository_sendingRequest);
     this._projectManager = new ProjectManager(repository, resolver, system, repository2);
     _projectManager.Logger = new LoggerController();
 }