public override void FixtureSetUp()
		{
			base.FixtureSetUp();
			project = WebReferenceTestHelper.CreateTestProject("C#");
			WebReferencesProjectItem item = new WebReferencesProjectItem(project);
			item.Include = "Web References\\";
			ProjectService.AddProjectItem(project, item);

			protocol = new DiscoveryClientProtocol();
			DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
			discoveryRef.Url = updateFromUrl;
			protocol.References.Add(discoveryRef);

			ContractReference contractRef = new ContractReference();
			contractRef.Url = "http://localhost/test.asmx?wsdl";
			contractRef.ClientProtocol = new DiscoveryClientProtocol();
			ServiceDescription desc = new ServiceDescription();
			contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
			protocol.References.Add(contractRef);

			WebReferenceTestHelper.InitializeProjectBindings();

			webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
			webReferencesProjectItem = WebReferenceTestHelper.GetProjectItem(webReference.Items, "Web References\\", ItemType.WebReferences);
		}
		public override void FixtureSetUp()
		{
			base.FixtureSetUp();
			// Set up the project.
			MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
			project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj");
			
			// Web references item.
			WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project);
			webReferencesItem.Include = "Web References\\";
			ProjectService.AddProjectItem(project, webReferencesItem);
			
			// Web reference url.
			WebReferenceUrl webReferenceUrl = new WebReferenceUrl(project);
			webReferenceUrl.Include = "http://localhost/test.asmx";
			webReferenceUrl.UpdateFromURL = "http://localhost/test.asmx";
			webReferenceUrl.RelPath = "Web References\\localhost";
			ProjectService.AddProjectItem(project, webReferenceUrl);
			
			FileProjectItem discoFileItem = new FileProjectItem(project, ItemType.None);
			discoFileItem.Include = "Web References\\localhost\\test.disco";
			ProjectService.AddProjectItem(project, discoFileItem);

			FileProjectItem wsdlFileItem = new FileProjectItem(project, ItemType.None);
			wsdlFileItem.Include = "Web References\\localhost\\test.wsdl";
			ProjectService.AddProjectItem(project, wsdlFileItem);
			
			// Proxy
			FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile);
			proxyItem.Include = "Web References\\localhost\\Reference.cs";
			proxyItem.DependentUpon = "Reference.map";
			ProjectService.AddProjectItem(project, proxyItem);
			
			// Reference map.
			FileProjectItem mapItem = new FileProjectItem(project, ItemType.None);
			mapItem.Include = "Web References\\localhost\\Reference.map";
			ProjectService.AddProjectItem(project, mapItem);
			
			// System.Web.Services reference.
			ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services");
			ProjectService.AddProjectItem(project, webServicesReferenceItem);
			
			// Set up the web reference.
			DiscoveryClientProtocol	protocol = new DiscoveryClientProtocol();
			DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
			discoveryRef.Url = "http://localhost/new.asmx";
			protocol.References.Add(discoveryRef);
			
			ContractReference contractRef = new ContractReference();
			contractRef.Url = "http://localhost/new.asmx?wsdl";
			contractRef.ClientProtocol = new DiscoveryClientProtocol();
			ServiceDescription desc = new ServiceDescription();
			contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
			protocol.References.Add(contractRef);
			
			WebReferenceTestHelper.InitializeProjectBindings();
			
			var webReference = new Gui.WebReference(project, "http://localhost/new.asmx", "localhost", "ProxyNamespace", protocol);
			changes = webReference.GetChanges(project);
		}
 WebReferencesProjectItem AddWebReferencesToProject(string include)
 {
     var item = new WebReferencesProjectItem(project);
     item.Include = @"Web References\";
     ProjectService.AddProjectItem(project, item);
     return item;
 }
		public override void FixtureSetUp()
		{
			base.FixtureSetUp();
			project = WebReferenceTestHelper.CreateTestProject("C#");
			project.FileName = FileName.Create("C:\\projects\\test\\foo.csproj");

			protocol = new DiscoveryClientProtocol();
			DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
			discoveryRef.Url = updateFromUrl;
			protocol.References.Add(discoveryRef);
			
			ContractReference contractRef = new ContractReference();
			contractRef.Url = "http://localhost/test.asmx?wsdl";
			contractRef.ClientProtocol = new DiscoveryClientProtocol();
			ServiceDescription desc = new ServiceDescription();
			contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
			protocol.References.Add(contractRef);
			
			WebReferenceTestHelper.InitializeProjectBindings();
			
			webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
			
			foreach (ProjectItem item in webReference.Items) {
				ProjectService.AddProjectItem(project, item);
			}
			webReferencesProjectItem = webReference.WebReferencesProjectItem;
		}
Esempio n. 5
0
		public void SetUpFixture()
		{
			project = WebReferenceTestHelper.CreateTestProject("C#");
			project.FileName = FileName.Create("C:\\projects\\test\\foo.csproj");

			protocol = new DiscoveryClientProtocol();
			DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
			discoveryRef.Url = updateFromUrl;
			protocol.References.Add(discoveryRef);
			
			ContractReference contractRef = new ContractReference();
			contractRef.Url = "http://localhost/test.asmx?wsdl";
			contractRef.ClientProtocol = new DiscoveryClientProtocol();
			ServiceDescription desc = new ServiceDescription();
			contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
			protocol.References.Add(contractRef);
			
			WebReferenceTestHelper.InitializeProjectBindings();
			
			webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
			
			webReferenceUrl = webReference.WebReferenceUrl;
			discoFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\test.disco", ItemType.None);
			referenceMapFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.map", ItemType.None);
			wsdlFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\test.wsdl", ItemType.None); 
			proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.cs", ItemType.Compile);
			webReferencesProjectItem = (WebReferencesProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, "Web References\\", ItemType.WebReferences);
			webServicesReferenceProjectItem = (ReferenceProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.Reference);
		}
		public void IsNotWebReferencesFolder1()
		{
			MSBuildBasedProject p = WebReferenceTestHelper.CreateTestProject("C#");
			p.FileName = "C:\\projects\\test\\foo.csproj";
			WebReferencesProjectItem item = new WebReferencesProjectItem(p);
			item.Include = "Web References\\";
			ProjectService.AddProjectItem(p, item);
				
			Assert.IsFalse(DirectoryNode.IsWebReferencesFolder(p, "C:\\projects\\test\\foo"));
		}
		public void SetupFixture()
		{
			project = WebReferenceTestHelper.CreateTestProject("C#");
			project.FileName = "C:\\Projects\\Web.csproj";
			WebReferencesProjectItem item = new WebReferencesProjectItem(project);
			item.Include = "Foo\\";
			ProjectService.AddProjectItem(project, item);
			
			protocol = new DiscoveryClientProtocol();
			
			WebReferenceTestHelper.InitializeProjectBindings();
			
			webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
			webReferenceUrl = (WebReferenceUrl)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.WebReferenceUrl);
		}
		public override void FixtureSetUp()
		{
			base.FixtureSetUp();
			MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
			project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj");
			
			// Web references item.
			WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project);
			webReferencesItem.Include = "Web References\\";
			ProjectService.AddProjectItem(project, webReferencesItem);
			
			// Web reference url.
			WebReferenceUrl webReferenceUrl = new WebReferenceUrl(project);
			webReferenceUrl.Include = "http://localhost/test.asmx";
			webReferenceUrl.UpdateFromURL = "http://localhost/test.asmx";
			webReferenceUrl.RelPath = "Web References\\localhost";
			ProjectService.AddProjectItem(project, webReferenceUrl);
			
			FileProjectItem discoFileItem = new FileProjectItem(project, ItemType.None);
			discoFileItem.Include = "Web References\\localhost\\test.disco";
			ProjectService.AddProjectItem(project, discoFileItem);

			FileProjectItem wsdlFileItem = new FileProjectItem(project, ItemType.None);
			wsdlFileItem.Include = "Web References\\localhost\\test.wsdl";
			ProjectService.AddProjectItem(project, wsdlFileItem);
			
			// Proxy
			FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile);
			proxyItem.Include = "Web References\\localhost\\Reference.cs";
			proxyItem.DependentUpon = "Reference.map";
			ProjectService.AddProjectItem(project, proxyItem);
			
			// Reference map.
			FileProjectItem mapItem = new FileProjectItem(project, ItemType.None);
			mapItem.Include = "Web References\\localhost\\Reference.map";
			ProjectService.AddProjectItem(project, mapItem);
			
			// System.Web.Services reference.
			ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services");
			ProjectService.AddProjectItem(project, webServicesReferenceItem);
			
			projectItems = WebReference.GetFileItems(project, "localhost");
		}
        public override void FixtureSetUp()
        {
            base.FixtureSetUp();
            project = WebReferenceTestHelper.CreateTestProject("C#");
            project.FileName = FileName.Create("C:\\Projects\\Web.csproj");
            WebReferencesProjectItem item = new WebReferencesProjectItem(project);
            item.Include = "Web References\\";
            ProjectService.AddProjectItem(project, item);

            protocol = new DiscoveryClientProtocol();
            DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
            discoveryRef.Url = updateFromUrl;
            protocol.References.Add(discoveryRef);

            ContractReference contractRef = new ContractReference();
            contractRef.Url = "http://localhost/test.asmx?wsdl";
            contractRef.ClientProtocol = new DiscoveryClientProtocol();
            ServiceDescription desc = new ServiceDescription();
            contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
            protocol.References.Add(contractRef);

            WebReferenceTestHelper.InitializeProjectBindings();

            webReference = new Gui.WebReference(project, updateFromUrl, oldName, proxyNamespace, protocol);

            // Force generation of items.
            List<ProjectItem> items = webReference.Items;

            // Change the web reference name.
            webReference.Name = name;
            webReferenceUrl = (WebReferenceUrl)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.WebReferenceUrl);

            discoFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\test.disco", ItemType.None);
            referenceMapFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\Reference.map", ItemType.None);
            wsdlFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\test.wsdl", ItemType.None);
            proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\Reference.cs", ItemType.Compile);
        }
		public void SetUpFixture()
		{
			MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
			project.FileName = Path.Combine(projectDirectory, "foo.csproj");
			project.AppDesignerFolder = "Properties";
			
			WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project);
			webReferencesItem.Include = "Web References\\";
			ProjectService.AddProjectItem(project, webReferencesItem);
									
			FileProjectItem fileItem = new FileProjectItem(project, ItemType.Folder);
			fileItem.Include = "MissingFolder\\";
			ProjectService.AddProjectItem(project, fileItem);
			
			ProjectNode projectNode = new ProjectNode(project);

			appDesignerFolderNode = DirectoryNodeFactory.CreateDirectoryNode(projectNode, project, Path.Combine(projectDirectory, "Properties"));
			ordinaryFolderNode = DirectoryNodeFactory.CreateDirectoryNode(projectNode, project, Path.Combine(project.Directory, "Test"));
			webReferencesFolderNode = DirectoryNodeFactory.CreateDirectoryNode(projectNode, project, Path.Combine(project.Directory, webReferencesItem.Include));	
			webReferenceNode = DirectoryNodeFactory.CreateDirectoryNode(webReferencesFolderNode, project, Path.Combine(Path.Combine(project.Directory, webReferencesItem.Include), "localhost"));
			
			missingWebReferencesFolderNode = DirectoryNodeFactory.CreateDirectoryNode(webReferencesItem, FileNodeStatus.Missing);
			missingOrdinaryFolderNode = DirectoryNodeFactory.CreateDirectoryNode(fileItem, FileNodeStatus.Missing);
		}
 public WebReferencesFolderNode(WebReferencesProjectItem projectItem) : this(projectItem.Directory)
 {
     ProjectItem = projectItem;
 }
Esempio n. 12
0
		public WebReferencesFolderNode(WebReferencesProjectItem projectItem, FileNodeStatus status)
			: this(projectItem.Directory, status)
		{
			ProjectItem = projectItem;
		}
Esempio n. 13
0
		public WebReferencesFolderNode(WebReferencesProjectItem projectItem)
			: this(projectItem, FileNodeStatus.None)
		{
		}
Esempio n. 14
0
 public WebReferencesFolderNode(WebReferencesProjectItem projectItem, FileNodeStatus status)
     : this(projectItem.Directory, status)
 {
     ProjectItem = projectItem;
 }
		public WebReferencesFolderNode(WebReferencesProjectItem projectItem) : this(projectItem.Directory)
		{
			ProjectItem = projectItem;
		}
Esempio n. 16
0
		List<ProjectItem> CreateProjectItems()
		{
			List<ProjectItem> items = new List<ProjectItem>();
			
			// Web references item.
			if (!ProjectContainsWebReferencesFolder(project)) {
				WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project);
				webReferencesItem.Include = "Web References\\";
				items.Add(webReferencesItem);
			}
			
			// Web reference url.
			webReferenceUrl = new WebReferenceUrl(project);
			webReferenceUrl.Include = url;
			webReferenceUrl.UpdateFromURL = url;
			webReferenceUrl.RelPath = relativePath;
			webReferenceUrl.Namespace = proxyNamespace;
			items.Add(webReferenceUrl);
			
			// References.
			foreach (DictionaryEntry entry in protocol.References) {
				DiscoveryReference discoveryRef = entry.Value as DiscoveryReference;
				if (discoveryRef != null) {
					FileProjectItem item = new FileProjectItem(project, ItemType.None);
					item.Include = Path.Combine(relativePath, discoveryRef.DefaultFilename);
					items.Add(item);
				}
			}
			
			// Proxy
			FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile);
			proxyItem.Include = GetProxyFileName();
			proxyItem.SetEvaluatedMetadata("AutoGen", "True");
			proxyItem.SetEvaluatedMetadata("DesignTime", "True");
			proxyItem.DependentUpon = "Reference.map";
			items.Add(proxyItem);
			
			// Reference map.
			FileProjectItem mapItem = new FileProjectItem(project, ItemType.None);
			mapItem.Include = Path.Combine(relativePath, "Reference.map");
			mapItem.SetEvaluatedMetadata("Generator", "MSDiscoCodeGenerator");
			mapItem.SetEvaluatedMetadata("LastGenOutput", "Reference.cs");
			items.Add(mapItem);
			
			// System.Web.Services reference.
			if (!ProjectContainsWebServicesReference(project)) {
				ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services");
				items.Add(webServicesReferenceItem);
			}
			return items;
		}
Esempio n. 17
0
 public WebReferencesFolderNode(WebReferencesProjectItem projectItem)
     : this(projectItem, FileNodeStatus.None)
 {
 }