void AddServiceReferenceFileToProject(ServiceReferenceFileName fileName)
		{
			var projectItem = new FileProjectItem(project, ItemType.Compile);
			projectItem.FileName = fileName.Path;
			projectItem.DependentUpon = "Reference.svcmap";
			AddProjectItemToProject(projectItem);
		}
Exemplo n.º 2
0
        void AddServiceReferenceFileToProject(ServiceReferenceFileName fileName)
        {
            var projectItem = new FileProjectItem(project, ItemType.Compile);

            projectItem.FileName      = fileName.Path;
            projectItem.DependentUpon = "Reference.svcmap";
            AddProjectItemToProject(projectItem);
        }
Exemplo n.º 3
0
        ServiceReferenceFileName StartProxyFileGeneration()
        {
            ServiceReferenceFileName referenceFileName = project.GetServiceReferenceFileName(fileGenerator.Options.ServiceName);

            CreateFolderForFileIfFolderMissing(referenceFileName.Path);

            CreateTempAppConfigFileIfOpenInTextEditor();

            Options.OutputFileName    = referenceFileName.Path;
            Options.AppConfigFileName = GetAppConfigFileName();
            Options.NoAppConfig       = false;
            Options.MergeAppConfig    = project.HasAppConfigFile();
            Options.MapProjectLanguage(project.Language);
            Options.GenerateNamespace(project.RootNamespace);
            Options.AddProjectReferencesIfUsingTypesFromProjectReferences(project.GetReferences());

            fileGenerator.Complete += ProxyFileGenerationComplete;
            fileGenerator.GenerateProxyFile();

            return(referenceFileName);
        }
		void SetServiceReferenceFileName(string serviceReferenceName, ServiceReferenceFileName fileName)
		{
			fakeProject.Stub(p => p.GetServiceReferenceFileName(serviceReferenceName)).Return(fileName);
		}
		ProjectItem GetFirstServiceReferenceFileInMSBuildProject(ServiceReferenceFileName fileName)
		{
			return msbuildProject.Items.SingleOrDefault(item => item.FileName == fileName.Path);
		}
		public void AddServiceReferenceProxyFile_ProjectHasNoServiceReferences_WCFMetadataStorageItemAddedToProjectForServiceReferencesFolder()
		{
			CreateProjectWithMSBuildProject();
			
			var proxyFileName = new ServiceReferenceFileName() { ServiceName = "Service1" };
			project.AddServiceReferenceProxyFile(proxyFileName);
			
			ProjectItem item = GetFirstWCFMetadataStorageItemInMSBuildProject();
			
			Assert.AreEqual(@"Service References\Service1", item.Include);
		}
		public void AddServiceReferenceProxyFile_ProjectHasNoServiceReferences_ProxyFileAddedToProjectAsFileToCompile()
		{
			CreateProjectWithMSBuildProject();
			
			var proxyFileName = new ServiceReferenceFileName() {
				ServiceReferencesFolder = @"d:\projects\MyProject\Service References",
				ServiceName = "Service1"
			};
			project.AddServiceReferenceProxyFile(proxyFileName);
			
			ProjectItem item = GetFirstServiceReferenceFileInMSBuildProject(proxyFileName);
			
			string dependentUpon = item.GetMetadata("DependentUpon");
			
			Assert.AreEqual(ItemType.Compile, item.ItemType);
			Assert.AreEqual("Reference.svcmap", dependentUpon);
		}
		public void AddServiceReference()
		{
			referenceFileName = StartProxyFileGeneration();
		}
Exemplo n.º 9
0
 public void AddServiceReference()
 {
     referenceFileName = StartProxyFileGeneration();
 }
		void CreateServiceReferenceFileName(string serviceReferencesFolder, string serviceName)
		{
			fileName = new ServiceReferenceFileName(serviceReferencesFolder, serviceName);
		}
		void AddServiceReferenceItemToProject(ServiceReferenceFileName fileName)
		{
			var projectItem = new ServiceReferenceProjectItem(project);
			projectItem.Include = @"Service References\" + fileName.ServiceName;
			AddProjectItemToProject(projectItem);
		}
		public void AddServiceReferenceProxyFile(ServiceReferenceFileName fileName)
		{
			AddServiceReferenceFileToProject(fileName);
			AddServiceReferencesItemToProject();
			AddServiceReferenceItemToProject(fileName);
		}
		public void AddServiceReferenceProxyFile_ProjectHasServiceReferences_WCFMetadataItemNotAddedToProjectForServiceReferencesRootFolder()
		{
			CreateProjectWithMSBuildProject();
			var proxyFileName = new ServiceReferenceFileName() { ServiceName = "Service1" };
			project.AddServiceReferenceProxyFile(proxyFileName);
			proxyFileName = new ServiceReferenceFileName() { ServiceName = "Service2" };
			
			project.AddServiceReferenceProxyFile(proxyFileName);
			
			int count = GetHowManyWCFMetadataItemsInMSBuildProject();
			
			Assert.AreEqual(1, count);
		}
Exemplo n.º 14
0
 public void AddServiceReferenceProxyFile(ServiceReferenceFileName fileName)
 {
     AddServiceReferenceFileToProject(fileName);
     AddServiceReferencesItemToProject();
     AddServiceReferenceItemToProject(fileName);
 }