30 changed files with 954 additions and 1204 deletions
@ -1,303 +0,0 @@
@@ -1,303 +0,0 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Collections.ObjectModel;
|
||||
//using System.Xml.Linq;
|
||||
//
|
||||
//using ICSharpCode.Core;
|
||||
//using ICSharpCode.SharpDevelop.Dom;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.StringTagProvider
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Mock IProject implementation to test the SharpDevelopStringTagProvider.
|
||||
// /// </summary>
|
||||
// public class MockProjectForTagProvider : IProject
|
||||
// {
|
||||
// string fileName = String.Empty;
|
||||
// string directory = String.Empty;
|
||||
// string outputAssemblyFullPath = String.Empty;
|
||||
// string name = String.Empty;
|
||||
//
|
||||
// public MockProjectForTagProvider()
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// public ReadOnlyCollection<ProjectItem> Items {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public ICollection<ItemType> AvailableFileItemTypes {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public List<ProjectSection> ProjectSections {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public LanguageProperties LanguageProperties {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string FileName {
|
||||
// get { return fileName; }
|
||||
// set { fileName = value; }
|
||||
// }
|
||||
//
|
||||
// public string Directory {
|
||||
// get { return directory; }
|
||||
// set { directory = value; }
|
||||
// }
|
||||
//
|
||||
// public bool ReadOnly {
|
||||
// get { return false; }
|
||||
// }
|
||||
//
|
||||
// public string AssemblyName {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// set {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string RootNamespace {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// set {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string OutputAssemblyFullPath {
|
||||
// get { return outputAssemblyFullPath; }
|
||||
// set { outputAssemblyFullPath = value; }
|
||||
// }
|
||||
//
|
||||
// public string Language {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string AppDesignerFolder {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string ActiveConfiguration {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// set {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string ActivePlatform {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// set {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public event EventHandler ActiveConfigurationChanged { add {} remove {} }
|
||||
//
|
||||
// public event EventHandler ActivePlatformChanged { add {} remove {} }
|
||||
//
|
||||
// public ICollection<string> ConfigurationNames {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public ICollection<string> PlatformNames {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public bool IsStartable {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public int MinimumSolutionVersion {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public object SyncRoot {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public ISolutionFolderContainer Parent {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// set {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public Solution ParentSolution {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string TypeGuid {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// set {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string IdGuid {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// set {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string Location {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// set {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public string Name {
|
||||
// get { return name; }
|
||||
// set { name = value; }
|
||||
// }
|
||||
//
|
||||
// public IEnumerable<ProjectItem> GetItemsOfType(ItemType type)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public ItemType GetDefaultItemType(string fileName)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public ICSharpCode.SharpDevelop.Dom.IAmbience GetAmbience()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public void Save()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public bool IsFileInProject(string fileName)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public FileProjectItem FindFile(string fileName)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public void Start(bool withDebugging)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public ParseProjectContent CreateProjectContent()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public ProjectItem CreateProjectItem(IProjectItemBackendStore item)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public void ResolveAssemblyReferences()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public ICollection<IBuildable> GetBuildDependencies(ProjectBuildOptions buildOptions)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public void StartBuild(ProjectBuildOptions buildOptions, IBuildFeedbackSink feedbackSink)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public ProjectBuildOptions CreateProjectBuildOptions(BuildOptions options, bool isRootBuildable)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public void Dispose()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public Properties CreateMemento()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public void SetMemento(ICSharpCode.Core.Properties memento)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public void ProjectCreationComplete()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public XElement LoadProjectExtensions(string name)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public void SaveProjectExtensions(string name, XElement element)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
//
|
||||
// public Properties ProjectSpecificProperties {
|
||||
// get {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
@ -1,113 +1,81 @@
@@ -1,113 +1,81 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using System;
|
||||
//using System.IO;
|
||||
//using ICSharpCode.SharpDevelop.Commands;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.StringTagProvider
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Tests the SharpDevelopStringTagProvider when there is an active project.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class ProjectTagsTestFixture
|
||||
// {
|
||||
// SharpDevelopStringTagProvider tagProvider;
|
||||
// MockProjectForTagProvider project;
|
||||
//
|
||||
// [SetUp]
|
||||
// public void Init()
|
||||
// {
|
||||
// project = new MockProjectForTagProvider();
|
||||
// project.FileName = @"C:\Projects\MyProject\MyProject.csproj";
|
||||
// project.Directory = @"C:\Projects\MyProject";
|
||||
// project.OutputAssemblyFullPath = @"C:\Projects\MyProject\bin\Debug\MyProject.exe";
|
||||
// project.Name = "MyProject";
|
||||
//
|
||||
// ProjectService.CurrentProject = project;
|
||||
// tagProvider = new SharpDevelopStringTagProvider();
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Sanity check the mock project implementation.
|
||||
// /// </summary>
|
||||
// [Test]
|
||||
// public void MockProjectFileName()
|
||||
// {
|
||||
// Assert.AreEqual(@"C:\Projects\MyProject\MyProject.csproj", project.FileName);
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Sanity check the mock project implementation.
|
||||
// /// </summary>
|
||||
// [Test]
|
||||
// public void MockProjectDirectory()
|
||||
// {
|
||||
// Assert.AreEqual(@"C:\Projects\MyProject", project.Directory);
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Sanity check the mock project implementation.
|
||||
// /// </summary>
|
||||
// [Test]
|
||||
// public void MockProjectOutputAssemblyFullPath()
|
||||
// {
|
||||
// Assert.AreEqual(@"C:\Projects\MyProject\bin\Debug\MyProject.exe", project.OutputAssemblyFullPath);
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Sanity check the mock project implementation.
|
||||
// /// </summary>
|
||||
// [Test]
|
||||
// public void MockProjectName()
|
||||
// {
|
||||
// Assert.AreEqual("MyProject", project.Name);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ConvertCurrentProjectName()
|
||||
// {
|
||||
// Assert.AreEqual(project.Name, tagProvider.ProvideString("CurrentProjectName"));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ConvertTargetPath()
|
||||
// {
|
||||
// Assert.AreEqual(project.OutputAssemblyFullPath, tagProvider.ProvideString("TargetPath"));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ConvertTargetDir()
|
||||
// {
|
||||
// Assert.AreEqual(Path.GetDirectoryName(project.OutputAssemblyFullPath), tagProvider.ProvideString("TargetDir"));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ConvertTargetName()
|
||||
// {
|
||||
// Assert.AreEqual("MyProject.exe", tagProvider.ProvideString("TargetName"));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ConvertTargetExt()
|
||||
// {
|
||||
// Assert.AreEqual(".exe", tagProvider.ProvideString("TargetExt"));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ConvertProjectDir()
|
||||
// {
|
||||
// Assert.AreEqual(project.Directory, tagProvider.ProvideString("ProjectDir"));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ConvertProjectFileName()
|
||||
// {
|
||||
// Assert.AreEqual(Path.GetFileName(project.FileName), tagProvider.ProvideString("ProjectFileName"));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Commands; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using Rhino.Mocks; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.StringTagProvider |
||||
{ |
||||
/// <summary>
|
||||
/// Tests the SharpDevelopStringTagProvider when there is an active project.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class ProjectTagsTestFixture : SDTestFixtureBase |
||||
{ |
||||
SharpDevelopStringTagProvider tagProvider; |
||||
IProject project; |
||||
|
||||
public override void FixtureSetUp() |
||||
{ |
||||
base.FixtureSetUp(); |
||||
project = MockRepository.GenerateStrictMock<IProject>(); |
||||
project.Stub(p => p.FileName).Return(FileName.Create(@"C:\Projects\MyProject\MyProject.csproj")); |
||||
project.Stub(p => p.Directory).Return(DirectoryName.Create(@"C:\Projects\MyProject")); |
||||
project.Stub(p => p.OutputAssemblyFullPath).Return(FileName.Create(@"C:\Projects\MyProject\bin\Debug\MyProject.exe")); |
||||
project.Stub(p => p.Name).Return("MyProject"); |
||||
|
||||
var projectService = MockRepository.GenerateStrictMock<IProjectService>(); |
||||
projectService.Stub(p => p.CurrentProject).Return(project); |
||||
SD.Services.AddService(typeof(IProjectService), projectService); |
||||
|
||||
tagProvider = new SharpDevelopStringTagProvider(); |
||||
} |
||||
|
||||
[Test] |
||||
public void ConvertCurrentProjectName() |
||||
{ |
||||
Assert.AreEqual(project.Name, tagProvider.ProvideString("CurrentProjectName")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ConvertTargetPath() |
||||
{ |
||||
Assert.AreEqual(project.OutputAssemblyFullPath.ToString(), tagProvider.ProvideString("TargetPath")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ConvertTargetDir() |
||||
{ |
||||
Assert.AreEqual(Path.GetDirectoryName(project.OutputAssemblyFullPath), tagProvider.ProvideString("TargetDir")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ConvertTargetName() |
||||
{ |
||||
Assert.AreEqual("MyProject.exe", tagProvider.ProvideString("TargetName")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ConvertTargetExt() |
||||
{ |
||||
Assert.AreEqual(".exe", tagProvider.ProvideString("TargetExt")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ConvertProjectDir() |
||||
{ |
||||
Assert.AreEqual(project.Directory.ToString(), tagProvider.ProvideString("ProjectDir")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ConvertProjectFileName() |
||||
{ |
||||
Assert.AreEqual(Path.GetFileName(project.FileName), tagProvider.ProvideString("ProjectFileName")); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,71 +1,70 @@
@@ -1,71 +1,70 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using ICSharpCode.SharpDevelop;
|
||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.IO;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Web.Services.Description;
|
||||
//using System.Web.Services.Discovery;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Tests that a new web reference does not generate a WebReferencesProjectItem
|
||||
// /// if the project already contains a web reference folder.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class ProjectHasExistingWebRefFolderTest
|
||||
// {
|
||||
// SD.WebReference webReference;
|
||||
// DiscoveryClientProtocol protocol;
|
||||
// ProjectItem webReferencesProjectItem;
|
||||
// MSBuildBasedProject project;
|
||||
//
|
||||
// string name = "localhost";
|
||||
// string proxyNamespace = "WebReferenceNamespace";
|
||||
// string updateFromUrl = "http://localhost/test.asmx";
|
||||
//
|
||||
// [TestFixtureSetUp]
|
||||
// public void SetUpFixture()
|
||||
// {
|
||||
// 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 SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
|
||||
// webReferencesProjectItem = WebReferenceTestHelper.GetProjectItem(webReference.Items, "Web References\\", ItemType.WebReferences);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ProjectItemContainsWebReferencesFolder()
|
||||
// {
|
||||
// Assert.IsTrue(SD.WebReference.ProjectContainsWebReferencesFolder(project));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferencesProjectItemDoesNotExist()
|
||||
// {
|
||||
// Assert.IsNull(webReferencesProjectItem);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.SharpDevelop; |
||||
using SD = ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.IO; |
||||
using System.Collections.Generic; |
||||
using System.Web.Services.Description; |
||||
using System.Web.Services.Discovery; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
/// <summary>
|
||||
/// Tests that a new web reference does not generate a WebReferencesProjectItem
|
||||
/// if the project already contains a web reference folder.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class ProjectHasExistingWebRefFolderTest : SDTestFixtureBase |
||||
{ |
||||
Gui.WebReference webReference; |
||||
DiscoveryClientProtocol protocol; |
||||
ProjectItem webReferencesProjectItem; |
||||
MSBuildBasedProject project; |
||||
|
||||
string name = "localhost"; |
||||
string proxyNamespace = "WebReferenceNamespace"; |
||||
string updateFromUrl = "http://localhost/test.asmx"; |
||||
|
||||
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); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectItemContainsWebReferencesFolder() |
||||
{ |
||||
Assert.IsTrue(Gui.WebReference.ProjectContainsWebReferencesFolder(project)); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferencesProjectItemDoesNotExist() |
||||
{ |
||||
Assert.IsNull(webReferencesProjectItem); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,90 +1,90 @@
@@ -1,90 +1,90 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using ICSharpCode.SharpDevelop.Gui;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Tests the WebReference.GetProjectItems method returns the
|
||||
// /// correct project items from a project.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class ProjectWebReferenceItemsTests
|
||||
// {
|
||||
// List<ProjectItem> projectItems;
|
||||
//
|
||||
// [TestFixtureSetUp]
|
||||
// public void SetUpFixture()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "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");
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ReferenceMapFileItemFound()
|
||||
// {
|
||||
// Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\Reference.map", ItemType.None));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ProxyFileItemFound()
|
||||
// {
|
||||
// Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\Reference.cs", ItemType.Compile));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WsdlFileItemFound()
|
||||
// {
|
||||
// Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\test.wsdl", ItemType.None));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void DiscoFileItemFound()
|
||||
// {
|
||||
// Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\test.disco", ItemType.None));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
/// <summary>
|
||||
/// Tests the WebReference.GetProjectItems method returns the
|
||||
/// correct project items from a project.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class ProjectWebReferenceItemsTests : SDTestFixtureBase |
||||
{ |
||||
List<ProjectItem> projectItems; |
||||
|
||||
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"); |
||||
} |
||||
|
||||
[Test] |
||||
public void ReferenceMapFileItemFound() |
||||
{ |
||||
Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\Reference.map", ItemType.None)); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProxyFileItemFound() |
||||
{ |
||||
Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\Reference.cs", ItemType.Compile)); |
||||
} |
||||
|
||||
[Test] |
||||
public void WsdlFileItemFound() |
||||
{ |
||||
Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\test.wsdl", ItemType.None)); |
||||
} |
||||
|
||||
[Test] |
||||
public void DiscoFileItemFound() |
||||
{ |
||||
Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\test.disco", ItemType.None)); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,62 +1,61 @@
@@ -1,62 +1,61 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using ICSharpCode.Core;
|
||||
//using ICSharpCode.SharpDevelop;
|
||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.IO;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Web.Services.Description;
|
||||
//using System.Web.Services.Discovery;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Non-standard web references folder name.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class RenamedWebReferencesFolderTest
|
||||
// {
|
||||
// SD.WebReference webReference;
|
||||
// DiscoveryClientProtocol protocol;
|
||||
// MSBuildBasedProject project;
|
||||
// WebReferenceUrl webReferenceUrl;
|
||||
//
|
||||
// string name = "localhost";
|
||||
// string proxyNamespace = "WebReferenceNamespace";
|
||||
// string updateFromUrl = "http://localhost/test.asmx";
|
||||
//
|
||||
// [TestFixtureSetUp]
|
||||
// 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);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferenceRelativePath()
|
||||
// {
|
||||
// Assert.AreEqual("Foo\\localhost", webReferenceUrl.RelPath);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferencesFolder()
|
||||
// {
|
||||
// Assert.AreEqual("C:\\Projects\\Foo", webReference.WebReferencesDirectory);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using SD = ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.IO; |
||||
using System.Collections.Generic; |
||||
using System.Web.Services.Description; |
||||
using System.Web.Services.Discovery; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
/// <summary>
|
||||
/// Non-standard web references folder name.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class RenamedWebReferencesFolderTest : SDTestFixtureBase |
||||
{ |
||||
Gui.WebReference webReference; |
||||
DiscoveryClientProtocol protocol; |
||||
MSBuildBasedProject project; |
||||
WebReferenceUrl webReferenceUrl; |
||||
|
||||
string name = "localhost"; |
||||
string proxyNamespace = "WebReferenceNamespace"; |
||||
string updateFromUrl = "http://localhost/test.asmx"; |
||||
|
||||
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 = "Foo\\"; |
||||
ProjectService.AddProjectItem(project, item); |
||||
|
||||
protocol = new DiscoveryClientProtocol(); |
||||
|
||||
WebReferenceTestHelper.InitializeProjectBindings(); |
||||
|
||||
webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); |
||||
webReferenceUrl = (WebReferenceUrl)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.WebReferenceUrl); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferenceRelativePath() |
||||
{ |
||||
Assert.AreEqual("Foo\\localhost", webReferenceUrl.RelPath); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferencesFolder() |
||||
{ |
||||
Assert.AreEqual("C:\\Projects\\Foo", webReference.WebReferencesDirectory); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,63 +1,62 @@
@@ -1,63 +1,62 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using ICSharpCode.SharpDevelop;
|
||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.IO;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Web.Services.Description;
|
||||
//using System.Web.Services.Discovery;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Tests that the generated filename ends with .vb if the project is
|
||||
// /// a vb project.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class VBNetWebReferenceTest
|
||||
// {
|
||||
// SD.WebReference webReference;
|
||||
// DiscoveryClientProtocol protocol;
|
||||
// FileProjectItem proxyFileProjectItem;
|
||||
// MSBuildBasedProject project;
|
||||
//
|
||||
// string name = "localhost";
|
||||
// string proxyNamespace = "WebReferenceNamespace";
|
||||
// string updateFromUrl = "http://localhost/test.asmx";
|
||||
//
|
||||
// [TestFixtureSetUp]
|
||||
// public void SetUpFixture()
|
||||
// {
|
||||
// project = WebReferenceTestHelper.CreateTestProject("VBNet");
|
||||
//
|
||||
// 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);
|
||||
//
|
||||
// proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.vb", ItemType.Compile);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void VBProxyFileExists()
|
||||
// {
|
||||
// Assert.IsNotNull(proxyFileProjectItem);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.SharpDevelop; |
||||
using SD = ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.IO; |
||||
using System.Collections.Generic; |
||||
using System.Web.Services.Description; |
||||
using System.Web.Services.Discovery; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
/// <summary>
|
||||
/// Tests that the generated filename ends with .vb if the project is
|
||||
/// a vb project.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class VBNetWebReferenceTest : SDTestFixtureBase |
||||
{ |
||||
Gui.WebReference webReference; |
||||
DiscoveryClientProtocol protocol; |
||||
FileProjectItem proxyFileProjectItem; |
||||
MSBuildBasedProject project; |
||||
|
||||
string name = "localhost"; |
||||
string proxyNamespace = "WebReferenceNamespace"; |
||||
string updateFromUrl = "http://localhost/test.asmx"; |
||||
|
||||
public override void FixtureSetUp() |
||||
{ |
||||
base.FixtureSetUp(); |
||||
project = WebReferenceTestHelper.CreateTestProject("VBNet"); |
||||
|
||||
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); |
||||
|
||||
proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.vb", ItemType.Compile); |
||||
} |
||||
|
||||
[Test] |
||||
public void VBProxyFileExists() |
||||
{ |
||||
Assert.IsNotNull(proxyFileProjectItem); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,125 +1,125 @@
@@ -1,125 +1,125 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.Web.Services.Description;
|
||||
//using System.Web.Services.Discovery;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Tests the WebReferenceChanges class.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class WebReferenceChangesTest
|
||||
// {
|
||||
// SD.WebReferenceChanges changes;
|
||||
//
|
||||
// [TestFixtureSetUp]
|
||||
// public void SetUpFixture()
|
||||
// {
|
||||
// // Set up the project.
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "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();
|
||||
//
|
||||
// SD.WebReference webReference = new SD.WebReference(project, "http://localhost/new.asmx", "localhost", "ProxyNamespace", protocol);
|
||||
// changes = webReference.GetChanges(project);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void HasChanged()
|
||||
// {
|
||||
// Assert.IsTrue(changes.Changed);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void HasNewWsdlFile()
|
||||
// {
|
||||
// Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.NewItems, "Web References\\localhost\\new.wsdl", ItemType.None));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void HasNewDiscoFile()
|
||||
// {
|
||||
// Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.NewItems, "Web References\\localhost\\new.disco", ItemType.None));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void OldWsdlFileRemoved()
|
||||
// {
|
||||
// Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.ItemsRemoved, "Web References\\localhost\\test.wsdl", ItemType.None));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void OldDiscoFileRemoved()
|
||||
// {
|
||||
// Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.ItemsRemoved, "Web References\\localhost\\test.disco", ItemType.None));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferenceUrlNotConsideredNewItem()
|
||||
// {
|
||||
// Assert.IsNull(WebReferenceTestHelper.GetProjectItem(changes.NewItems, ItemType.WebReferenceUrl));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferenceUrlNotConsideredRemoved()
|
||||
// {
|
||||
// Assert.IsNull(WebReferenceTestHelper.GetProjectItem(changes.ItemsRemoved, ItemType.WebReferenceUrl));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Web.Services.Description; |
||||
using System.Web.Services.Discovery; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
/// <summary>
|
||||
/// Tests the WebReferenceChanges class.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class WebReferenceChangesTest : SDTestFixtureBase |
||||
{ |
||||
WebReferenceChanges changes; |
||||
|
||||
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); |
||||
} |
||||
|
||||
[Test] |
||||
public void HasChanged() |
||||
{ |
||||
Assert.IsTrue(changes.Changed); |
||||
} |
||||
|
||||
[Test] |
||||
public void HasNewWsdlFile() |
||||
{ |
||||
Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.NewItems, "Web References\\localhost\\new.wsdl", ItemType.None)); |
||||
} |
||||
|
||||
[Test] |
||||
public void HasNewDiscoFile() |
||||
{ |
||||
Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.NewItems, "Web References\\localhost\\new.disco", ItemType.None)); |
||||
} |
||||
|
||||
[Test] |
||||
public void OldWsdlFileRemoved() |
||||
{ |
||||
Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.ItemsRemoved, "Web References\\localhost\\test.wsdl", ItemType.None)); |
||||
} |
||||
|
||||
[Test] |
||||
public void OldDiscoFileRemoved() |
||||
{ |
||||
Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.ItemsRemoved, "Web References\\localhost\\test.disco", ItemType.None)); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferenceUrlNotConsideredNewItem() |
||||
{ |
||||
Assert.IsNull(WebReferenceTestHelper.GetProjectItem(changes.NewItems, ItemType.WebReferenceUrl)); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferenceUrlNotConsideredRemoved() |
||||
{ |
||||
Assert.IsNull(WebReferenceTestHelper.GetProjectItem(changes.ItemsRemoved, ItemType.WebReferenceUrl)); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,125 +1,124 @@
@@ -1,125 +1,124 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using ICSharpCode.Core;
|
||||
//using ICSharpCode.SharpDevelop;
|
||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.IO;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Web.Services.Description;
|
||||
//using System.Web.Services.Discovery;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Checks that the web reference folder name is changed if
|
||||
// /// one exists with the same name.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class WebReferenceFolderAlreadyExistsTest
|
||||
// {
|
||||
// SD.WebReference webReference;
|
||||
// DiscoveryClientProtocol protocol;
|
||||
// MSBuildBasedProject project;
|
||||
// WebReferenceUrl webReferenceUrl;
|
||||
// FileProjectItem discoFileProjectItem;
|
||||
// FileProjectItem referenceMapFileProjectItem;
|
||||
// FileProjectItem wsdlFileProjectItem;
|
||||
// FileProjectItem proxyFileProjectItem;
|
||||
//
|
||||
// string oldName = "localhost";
|
||||
// string name = "localhost1";
|
||||
// string proxyNamespace = "WebReferenceNamespace";
|
||||
// string updateFromUrl = "http://localhost/test.asmx";
|
||||
//
|
||||
// [TestFixtureSetUp]
|
||||
// public void SetupFixture()
|
||||
// {
|
||||
// project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "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 SD.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);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferenceRelativePath()
|
||||
// {
|
||||
// Assert.AreEqual("Web References\\localhost1", webReferenceUrl.RelPath);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferenceName()
|
||||
// {
|
||||
// Assert.AreEqual(name, webReference.Name);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferenceDirectory()
|
||||
// {
|
||||
// Assert.AreEqual(Path.Combine(project.Directory, "Web References\\localhost1"), webReference.Directory);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ProxyFileName()
|
||||
// {
|
||||
// Assert.AreEqual("C:\\Projects\\Web References\\localhost1\\Reference.cs", webReference.WebProxyFileName);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void DiscoFileItemExists()
|
||||
// {
|
||||
// Assert.IsNotNull(discoFileProjectItem);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WsdlFileItemExists()
|
||||
// {
|
||||
// Assert.IsNotNull(wsdlFileProjectItem);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ReferenceMapFileItemExists()
|
||||
// {
|
||||
// Assert.IsNotNull(referenceMapFileProjectItem);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ProxyFileItemExists()
|
||||
// {
|
||||
// Assert.IsNotNull(proxyFileProjectItem);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using SD = ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.IO; |
||||
using System.Collections.Generic; |
||||
using System.Web.Services.Description; |
||||
using System.Web.Services.Discovery; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
/// <summary>
|
||||
/// Checks that the web reference folder name is changed if
|
||||
/// one exists with the same name.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class WebReferenceFolderAlreadyExistsTest : SDTestFixtureBase |
||||
{ |
||||
Gui.WebReference webReference; |
||||
DiscoveryClientProtocol protocol; |
||||
MSBuildBasedProject project; |
||||
WebReferenceUrl webReferenceUrl; |
||||
FileProjectItem discoFileProjectItem; |
||||
FileProjectItem referenceMapFileProjectItem; |
||||
FileProjectItem wsdlFileProjectItem; |
||||
FileProjectItem proxyFileProjectItem; |
||||
|
||||
string oldName = "localhost"; |
||||
string name = "localhost1"; |
||||
string proxyNamespace = "WebReferenceNamespace"; |
||||
string updateFromUrl = "http://localhost/test.asmx"; |
||||
|
||||
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); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferenceRelativePath() |
||||
{ |
||||
Assert.AreEqual("Web References\\localhost1", webReferenceUrl.RelPath); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferenceName() |
||||
{ |
||||
Assert.AreEqual(name, webReference.Name); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferenceDirectory() |
||||
{ |
||||
Assert.AreEqual(Path.Combine(project.Directory, "Web References\\localhost1"), webReference.Directory); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProxyFileName() |
||||
{ |
||||
Assert.AreEqual("C:\\Projects\\Web References\\localhost1\\Reference.cs", webReference.WebProxyFileName); |
||||
} |
||||
|
||||
[Test] |
||||
public void DiscoFileItemExists() |
||||
{ |
||||
Assert.IsNotNull(discoFileProjectItem); |
||||
} |
||||
|
||||
[Test] |
||||
public void WsdlFileItemExists() |
||||
{ |
||||
Assert.IsNotNull(wsdlFileProjectItem); |
||||
} |
||||
|
||||
[Test] |
||||
public void ReferenceMapFileItemExists() |
||||
{ |
||||
Assert.IsNotNull(referenceMapFileProjectItem); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProxyFileItemExists() |
||||
{ |
||||
Assert.IsNotNull(proxyFileProjectItem); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,68 +1,67 @@
@@ -1,68 +1,67 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using ICSharpCode.SharpDevelop;
|
||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.IO;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Web.Services.Description;
|
||||
//using System.Web.Services.Discovery;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Tests the generated items are not changed if the items have been
|
||||
// /// added to the project. Previously a WebReferencesProjectItem would be
|
||||
// /// missing after the items have been added to the project.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class WebReferenceProjectItemsCachedTest
|
||||
// {
|
||||
// SD.WebReference webReference;
|
||||
// DiscoveryClientProtocol protocol;
|
||||
// WebReferencesProjectItem webReferencesProjectItem;
|
||||
// MSBuildBasedProject project;
|
||||
//
|
||||
// string name = "localhost";
|
||||
// string proxyNamespace = "WebReferenceNamespace";
|
||||
// string updateFromUrl = "http://localhost/test.asmx";
|
||||
//
|
||||
// [TestFixtureSetUp]
|
||||
// public void SetUpFixture()
|
||||
// {
|
||||
// project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "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);
|
||||
//
|
||||
// foreach (ProjectItem item in webReference.Items) {
|
||||
// ProjectService.AddProjectItem(project, item);
|
||||
// }
|
||||
// webReferencesProjectItem = webReference.WebReferencesProjectItem;
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebReferencesProjectItemExists()
|
||||
// {
|
||||
// Assert.IsNotNull(webReferencesProjectItem);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.IO; |
||||
using System.Collections.Generic; |
||||
using System.Web.Services.Description; |
||||
using System.Web.Services.Discovery; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
/// <summary>
|
||||
/// Tests the generated items are not changed if the items have been
|
||||
/// added to the project. Previously a WebReferencesProjectItem would be
|
||||
/// missing after the items have been added to the project.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class WebReferenceProjectItemsCachedTest : SDTestFixtureBase |
||||
{ |
||||
Gui.WebReference webReference; |
||||
DiscoveryClientProtocol protocol; |
||||
WebReferencesProjectItem webReferencesProjectItem; |
||||
MSBuildBasedProject project; |
||||
|
||||
string name = "localhost"; |
||||
string proxyNamespace = "WebReferenceNamespace"; |
||||
string updateFromUrl = "http://localhost/test.asmx"; |
||||
|
||||
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; |
||||
} |
||||
|
||||
[Test] |
||||
public void WebReferencesProjectItemExists() |
||||
{ |
||||
Assert.IsNotNull(webReferencesProjectItem); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,78 +1,78 @@
@@ -1,78 +1,78 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.IO;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// [TestFixture]
|
||||
// public class WebReferenceUrlTests
|
||||
// {
|
||||
// [Test]
|
||||
// public void FileName()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
||||
// url.RelPath = "Web References\\localhost";
|
||||
// url.Include = "http://localhost/test.asmx";
|
||||
//
|
||||
// Assert.AreEqual(Path.Combine(project.Directory, url.RelPath), url.FileName);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void RelPathEndsWithSlash()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
||||
// url.RelPath = "Web References\\localhost\\";
|
||||
// url.Include = "http://localhost/test.asmx";
|
||||
//
|
||||
// Assert.AreEqual(Path.Combine(project.Directory, url.RelPath.Trim('\\')), url.FileName);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void ChangeFileName()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
||||
// url.RelPath = "Web References\\localhost";
|
||||
// url.Include = "http://localhost/test.asmx";
|
||||
//
|
||||
// // Change filename - simulate a folder rename.
|
||||
// url.FileName = "c:\\projects\\test\\Web References\\mywebservice";
|
||||
//
|
||||
// Assert.AreEqual("http://localhost/test.asmx", url.Include);
|
||||
// Assert.AreEqual("Web References\\mywebservice", url.RelPath);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void NoNamespaceSpecified()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
||||
// project.RootNamespace = "TestRootNamespace";
|
||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
||||
//
|
||||
// Assert.AreEqual("TestRootNamespace", url.Namespace);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void NamespaceSpecified()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
||||
// project.RootNamespace = "TestRootNamespace";
|
||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
||||
// url.Namespace = "WebReferenceNamespace";
|
||||
//
|
||||
// Assert.AreEqual("WebReferenceNamespace", url.Namespace);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.IO; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
[TestFixture] |
||||
public class WebReferenceUrlTests : SDTestFixtureBase |
||||
{ |
||||
[Test] |
||||
public void FileNameTest() |
||||
{ |
||||
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||
WebReferenceUrl url = new WebReferenceUrl(project); |
||||
url.RelPath = "Web References\\localhost"; |
||||
url.Include = "http://localhost/test.asmx"; |
||||
|
||||
Assert.AreEqual(project.Directory.CombineFile(url.RelPath), url.FileName); |
||||
} |
||||
|
||||
[Test] |
||||
public void RelPathEndsWithSlash() |
||||
{ |
||||
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||
WebReferenceUrl url = new WebReferenceUrl(project); |
||||
url.RelPath = "Web References\\localhost\\"; |
||||
url.Include = "http://localhost/test.asmx"; |
||||
|
||||
Assert.AreEqual(project.Directory.CombineFile(url.RelPath.Trim('\\')), url.FileName); |
||||
} |
||||
|
||||
[Test] |
||||
public void ChangeFileName() |
||||
{ |
||||
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||
WebReferenceUrl url = new WebReferenceUrl(project); |
||||
url.RelPath = "Web References\\localhost"; |
||||
url.Include = "http://localhost/test.asmx"; |
||||
|
||||
// Change filename - simulate a folder rename.
|
||||
url.FileName = FileName.Create("c:\\projects\\test\\Web References\\mywebservice"); |
||||
|
||||
Assert.AreEqual("http://localhost/test.asmx", url.Include); |
||||
Assert.AreEqual("Web References\\mywebservice", url.RelPath); |
||||
} |
||||
|
||||
[Test] |
||||
public void NoNamespaceSpecified() |
||||
{ |
||||
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||
project.RootNamespace = "TestRootNamespace"; |
||||
WebReferenceUrl url = new WebReferenceUrl(project); |
||||
|
||||
Assert.AreEqual("TestRootNamespace", url.Namespace); |
||||
} |
||||
|
||||
[Test] |
||||
public void NamespaceSpecified() |
||||
{ |
||||
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||
project.RootNamespace = "TestRootNamespace"; |
||||
WebReferenceUrl url = new WebReferenceUrl(project); |
||||
url.Namespace = "WebReferenceNamespace"; |
||||
|
||||
Assert.AreEqual("WebReferenceNamespace", url.Namespace); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,96 +1,96 @@
@@ -1,96 +1,96 @@
|
||||
#warning
|
||||
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
//using ICSharpCode.SharpDevelop;
|
||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
||||
//using ICSharpCode.SharpDevelop.Project;
|
||||
//using NUnit.Framework;
|
||||
//using System;
|
||||
//using System.IO;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Web.Services.Description;
|
||||
//using System.Web.Services.Discovery;
|
||||
//
|
||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Tests that the generated project items for a web reference do not include
|
||||
// /// a reference to System.Web.Services if one already exists in the project.
|
||||
// /// </summary>
|
||||
// [TestFixture]
|
||||
// public class WebServicesReferenceExistsTest
|
||||
// {
|
||||
// SD.WebReference webReference;
|
||||
// DiscoveryClientProtocol protocol;
|
||||
// ReferenceProjectItem webServicesReferenceProjectItem;
|
||||
// MSBuildBasedProject project;
|
||||
//
|
||||
// string name = "localhost";
|
||||
// string proxyNamespace = "WebReferenceNamespace";
|
||||
// string updateFromUrl = "http://localhost/test.asmx";
|
||||
//
|
||||
// [TestFixtureSetUp]
|
||||
// public void SetUpFixture()
|
||||
// {
|
||||
// project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// project.FileName = "C:\\projects\\test\\foo.csproj";
|
||||
//
|
||||
// ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services");
|
||||
// ProjectService.AddProjectItem(project, referenceItem);
|
||||
//
|
||||
// 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);
|
||||
// webServicesReferenceProjectItem = (ReferenceProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.Reference);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebServicesReferenceItemDoesNotExist()
|
||||
// {
|
||||
// Assert.IsNull(webServicesReferenceProjectItem);
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebServicesReferenceDoesNotExist1()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Windows.Forms");
|
||||
// ProjectService.AddProjectItem(project, referenceItem);
|
||||
//
|
||||
// Assert.IsFalse(SD.WebReference.ProjectContainsWebServicesReference(project));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebServicesReferenceExists1()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "system.web.services");
|
||||
// ProjectService.AddProjectItem(project, referenceItem);
|
||||
//
|
||||
// Assert.IsTrue(SD.WebReference.ProjectContainsWebServicesReference(project));
|
||||
// }
|
||||
//
|
||||
// [Test]
|
||||
// public void WebServicesReferenceExists2()
|
||||
// {
|
||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
||||
// ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
|
||||
// ProjectService.AddProjectItem(project, referenceItem);
|
||||
//
|
||||
// Assert.IsTrue(SD.WebReference.ProjectContainsWebServicesReference(project));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using SD = ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.IO; |
||||
using System.Collections.Generic; |
||||
using System.Web.Services.Description; |
||||
using System.Web.Services.Discovery; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||
{ |
||||
/// <summary>
|
||||
/// Tests that the generated project items for a web reference do not include
|
||||
/// a reference to System.Web.Services if one already exists in the project.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class WebServicesReferenceExistsTest : SDTestFixtureBase |
||||
{ |
||||
Gui.WebReference webReference; |
||||
DiscoveryClientProtocol protocol; |
||||
ReferenceProjectItem webServicesReferenceProjectItem; |
||||
MSBuildBasedProject project; |
||||
|
||||
string name = "localhost"; |
||||
string proxyNamespace = "WebReferenceNamespace"; |
||||
string updateFromUrl = "http://localhost/test.asmx"; |
||||
|
||||
public override void FixtureSetUp() |
||||
{ |
||||
base.FixtureSetUp(); |
||||
project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
project.FileName = FileName.Create("C:\\projects\\test\\foo.csproj"); |
||||
|
||||
ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services"); |
||||
ProjectService.AddProjectItem(project, referenceItem); |
||||
|
||||
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); |
||||
webServicesReferenceProjectItem = (ReferenceProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.Reference); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebServicesReferenceItemDoesNotExist() |
||||
{ |
||||
Assert.IsNull(webServicesReferenceProjectItem); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebServicesReferenceDoesNotExist1() |
||||
{ |
||||
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Windows.Forms"); |
||||
ProjectService.AddProjectItem(project, referenceItem); |
||||
|
||||
Assert.IsFalse(Gui.WebReference.ProjectContainsWebServicesReference(project)); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebServicesReferenceExists1() |
||||
{ |
||||
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "system.web.services"); |
||||
ProjectService.AddProjectItem(project, referenceItem); |
||||
|
||||
Assert.IsTrue(Gui.WebReference.ProjectContainsWebServicesReference(project)); |
||||
} |
||||
|
||||
[Test] |
||||
public void WebServicesReferenceExists2() |
||||
{ |
||||
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||
ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); |
||||
ProjectService.AddProjectItem(project, referenceItem); |
||||
|
||||
Assert.IsTrue(Gui.WebReference.ProjectContainsWebServicesReference(project)); |
||||
} |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue