30 changed files with 954 additions and 1204 deletions
@ -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 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using System; |
||||||
//using System;
|
using System.IO; |
||||||
//using System.IO;
|
using ICSharpCode.Core; |
||||||
//using ICSharpCode.SharpDevelop.Commands;
|
using ICSharpCode.SharpDevelop.Commands; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using NUnit.Framework;
|
using NUnit.Framework; |
||||||
//
|
using Rhino.Mocks; |
||||||
//namespace ICSharpCode.SharpDevelop.Tests.StringTagProvider
|
|
||||||
//{
|
namespace ICSharpCode.SharpDevelop.Tests.StringTagProvider |
||||||
// /// <summary>
|
{ |
||||||
// /// Tests the SharpDevelopStringTagProvider when there is an active project.
|
/// <summary>
|
||||||
// /// </summary>
|
/// Tests the SharpDevelopStringTagProvider when there is an active project.
|
||||||
// [TestFixture]
|
/// </summary>
|
||||||
// public class ProjectTagsTestFixture
|
[TestFixture] |
||||||
// {
|
public class ProjectTagsTestFixture : SDTestFixtureBase |
||||||
// SharpDevelopStringTagProvider tagProvider;
|
{ |
||||||
// MockProjectForTagProvider project;
|
SharpDevelopStringTagProvider tagProvider; |
||||||
//
|
IProject project; |
||||||
// [SetUp]
|
|
||||||
// public void Init()
|
public override void FixtureSetUp() |
||||||
// {
|
{ |
||||||
// project = new MockProjectForTagProvider();
|
base.FixtureSetUp(); |
||||||
// project.FileName = @"C:\Projects\MyProject\MyProject.csproj";
|
project = MockRepository.GenerateStrictMock<IProject>(); |
||||||
// project.Directory = @"C:\Projects\MyProject";
|
project.Stub(p => p.FileName).Return(FileName.Create(@"C:\Projects\MyProject\MyProject.csproj")); |
||||||
// project.OutputAssemblyFullPath = @"C:\Projects\MyProject\bin\Debug\MyProject.exe";
|
project.Stub(p => p.Directory).Return(DirectoryName.Create(@"C:\Projects\MyProject")); |
||||||
// project.Name = "MyProject";
|
project.Stub(p => p.OutputAssemblyFullPath).Return(FileName.Create(@"C:\Projects\MyProject\bin\Debug\MyProject.exe")); |
||||||
//
|
project.Stub(p => p.Name).Return("MyProject"); |
||||||
// ProjectService.CurrentProject = project;
|
|
||||||
// tagProvider = new SharpDevelopStringTagProvider();
|
var projectService = MockRepository.GenerateStrictMock<IProjectService>(); |
||||||
// }
|
projectService.Stub(p => p.CurrentProject).Return(project); |
||||||
//
|
SD.Services.AddService(typeof(IProjectService), projectService); |
||||||
// /// <summary>
|
|
||||||
// /// Sanity check the mock project implementation.
|
tagProvider = new SharpDevelopStringTagProvider(); |
||||||
// /// </summary>
|
} |
||||||
// [Test]
|
|
||||||
// public void MockProjectFileName()
|
[Test] |
||||||
// {
|
public void ConvertCurrentProjectName() |
||||||
// Assert.AreEqual(@"C:\Projects\MyProject\MyProject.csproj", project.FileName);
|
{ |
||||||
// }
|
Assert.AreEqual(project.Name, tagProvider.ProvideString("CurrentProjectName")); |
||||||
//
|
} |
||||||
// /// <summary>
|
|
||||||
// /// Sanity check the mock project implementation.
|
[Test] |
||||||
// /// </summary>
|
public void ConvertTargetPath() |
||||||
// [Test]
|
{ |
||||||
// public void MockProjectDirectory()
|
Assert.AreEqual(project.OutputAssemblyFullPath.ToString(), tagProvider.ProvideString("TargetPath")); |
||||||
// {
|
} |
||||||
// Assert.AreEqual(@"C:\Projects\MyProject", project.Directory);
|
|
||||||
// }
|
[Test] |
||||||
//
|
public void ConvertTargetDir() |
||||||
// /// <summary>
|
{ |
||||||
// /// Sanity check the mock project implementation.
|
Assert.AreEqual(Path.GetDirectoryName(project.OutputAssemblyFullPath), tagProvider.ProvideString("TargetDir")); |
||||||
// /// </summary>
|
} |
||||||
// [Test]
|
|
||||||
// public void MockProjectOutputAssemblyFullPath()
|
[Test] |
||||||
// {
|
public void ConvertTargetName() |
||||||
// Assert.AreEqual(@"C:\Projects\MyProject\bin\Debug\MyProject.exe", project.OutputAssemblyFullPath);
|
{ |
||||||
// }
|
Assert.AreEqual("MyProject.exe", tagProvider.ProvideString("TargetName")); |
||||||
//
|
} |
||||||
// /// <summary>
|
|
||||||
// /// Sanity check the mock project implementation.
|
[Test] |
||||||
// /// </summary>
|
public void ConvertTargetExt() |
||||||
// [Test]
|
{ |
||||||
// public void MockProjectName()
|
Assert.AreEqual(".exe", tagProvider.ProvideString("TargetExt")); |
||||||
// {
|
} |
||||||
// Assert.AreEqual("MyProject", project.Name);
|
|
||||||
// }
|
[Test] |
||||||
//
|
public void ConvertProjectDir() |
||||||
// [Test]
|
{ |
||||||
// public void ConvertCurrentProjectName()
|
Assert.AreEqual(project.Directory.ToString(), tagProvider.ProvideString("ProjectDir")); |
||||||
// {
|
} |
||||||
// Assert.AreEqual(project.Name, tagProvider.ProvideString("CurrentProjectName"));
|
|
||||||
// }
|
[Test] |
||||||
//
|
public void ConvertProjectFileName() |
||||||
// [Test]
|
{ |
||||||
// public void ConvertTargetPath()
|
Assert.AreEqual(Path.GetFileName(project.FileName), tagProvider.ProvideString("ProjectFileName")); |
||||||
// {
|
} |
||||||
// 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"));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|||||||
@ -1,71 +1,70 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using ICSharpCode.SharpDevelop; |
||||||
//using ICSharpCode.SharpDevelop;
|
using SD = ICSharpCode.SharpDevelop.Gui; |
||||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using NUnit.Framework; |
||||||
//using NUnit.Framework;
|
using System; |
||||||
//using System;
|
using System.IO; |
||||||
//using System.IO;
|
using System.Collections.Generic; |
||||||
//using System.Collections.Generic;
|
using System.Web.Services.Description; |
||||||
//using System.Web.Services.Description;
|
using System.Web.Services.Discovery; |
||||||
//using System.Web.Services.Discovery;
|
|
||||||
//
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
{ |
||||||
//{
|
/// <summary>
|
||||||
// /// <summary>
|
/// Tests that a new web reference does not generate a WebReferencesProjectItem
|
||||||
// /// Tests that a new web reference does not generate a WebReferencesProjectItem
|
/// if the project already contains a web reference folder.
|
||||||
// /// if the project already contains a web reference folder.
|
/// </summary>
|
||||||
// /// </summary>
|
[TestFixture] |
||||||
// [TestFixture]
|
public class ProjectHasExistingWebRefFolderTest : SDTestFixtureBase |
||||||
// public class ProjectHasExistingWebRefFolderTest
|
{ |
||||||
// {
|
Gui.WebReference webReference; |
||||||
// SD.WebReference webReference;
|
DiscoveryClientProtocol protocol; |
||||||
// DiscoveryClientProtocol protocol;
|
ProjectItem webReferencesProjectItem; |
||||||
// ProjectItem webReferencesProjectItem;
|
MSBuildBasedProject project; |
||||||
// MSBuildBasedProject project;
|
|
||||||
//
|
string name = "localhost"; |
||||||
// string name = "localhost";
|
string proxyNamespace = "WebReferenceNamespace"; |
||||||
// string proxyNamespace = "WebReferenceNamespace";
|
string updateFromUrl = "http://localhost/test.asmx"; |
||||||
// string updateFromUrl = "http://localhost/test.asmx";
|
|
||||||
//
|
public override void FixtureSetUp() |
||||||
// [TestFixtureSetUp]
|
{ |
||||||
// public void SetUpFixture()
|
base.FixtureSetUp(); |
||||||
// {
|
project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project = WebReferenceTestHelper.CreateTestProject("C#");
|
WebReferencesProjectItem item = new WebReferencesProjectItem(project); |
||||||
// WebReferencesProjectItem item = new WebReferencesProjectItem(project);
|
item.Include = "Web References\\"; |
||||||
// item.Include = "Web References\\";
|
ProjectService.AddProjectItem(project, item); |
||||||
// ProjectService.AddProjectItem(project, item);
|
|
||||||
//
|
protocol = new DiscoveryClientProtocol(); |
||||||
// protocol = new DiscoveryClientProtocol();
|
DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); |
||||||
// DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
|
discoveryRef.Url = updateFromUrl; |
||||||
// discoveryRef.Url = updateFromUrl;
|
protocol.References.Add(discoveryRef); |
||||||
// protocol.References.Add(discoveryRef);
|
|
||||||
//
|
ContractReference contractRef = new ContractReference(); |
||||||
// ContractReference contractRef = new ContractReference();
|
contractRef.Url = "http://localhost/test.asmx?wsdl"; |
||||||
// contractRef.Url = "http://localhost/test.asmx?wsdl";
|
contractRef.ClientProtocol = new DiscoveryClientProtocol(); |
||||||
// contractRef.ClientProtocol = new DiscoveryClientProtocol();
|
ServiceDescription desc = new ServiceDescription(); |
||||||
// ServiceDescription desc = new ServiceDescription();
|
contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); |
||||||
// contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
|
protocol.References.Add(contractRef); |
||||||
// protocol.References.Add(contractRef);
|
|
||||||
//
|
WebReferenceTestHelper.InitializeProjectBindings(); |
||||||
// WebReferenceTestHelper.InitializeProjectBindings();
|
|
||||||
//
|
webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); |
||||||
// webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
|
webReferencesProjectItem = WebReferenceTestHelper.GetProjectItem(webReference.Items, "Web References\\", ItemType.WebReferences); |
||||||
// webReferencesProjectItem = WebReferenceTestHelper.GetProjectItem(webReference.Items, "Web References\\", ItemType.WebReferences);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void ProjectItemContainsWebReferencesFolder() |
||||||
// public void ProjectItemContainsWebReferencesFolder()
|
{ |
||||||
// {
|
Assert.IsTrue(Gui.WebReference.ProjectContainsWebReferencesFolder(project)); |
||||||
// Assert.IsTrue(SD.WebReference.ProjectContainsWebReferencesFolder(project));
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void WebReferencesProjectItemDoesNotExist() |
||||||
// public void WebReferencesProjectItemDoesNotExist()
|
{ |
||||||
// {
|
Assert.IsNull(webReferencesProjectItem); |
||||||
// Assert.IsNull(webReferencesProjectItem);
|
} |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
|
||||||
|
|||||||
@ -1,90 +1,90 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// 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.Gui; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using NUnit.Framework;
|
using NUnit.Framework; |
||||||
//using System;
|
using System; |
||||||
//using System.Collections.Generic;
|
using System.Collections.Generic; |
||||||
//
|
|
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//{
|
{ |
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// Tests the WebReference.GetProjectItems method returns the
|
/// Tests the WebReference.GetProjectItems method returns the
|
||||||
// /// correct project items from a project.
|
/// correct project items from a project.
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// [TestFixture]
|
[TestFixture] |
||||||
// public class ProjectWebReferenceItemsTests
|
public class ProjectWebReferenceItemsTests : SDTestFixtureBase |
||||||
// {
|
{ |
||||||
// List<ProjectItem> projectItems;
|
List<ProjectItem> projectItems; |
||||||
//
|
|
||||||
// [TestFixtureSetUp]
|
public override void FixtureSetUp() |
||||||
// public void SetUpFixture()
|
{ |
||||||
// {
|
base.FixtureSetUp(); |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||||
//
|
|
||||||
// // Web references item.
|
// Web references item.
|
||||||
// WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project);
|
WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project); |
||||||
// webReferencesItem.Include = "Web References\\";
|
webReferencesItem.Include = "Web References\\"; |
||||||
// ProjectService.AddProjectItem(project, webReferencesItem);
|
ProjectService.AddProjectItem(project, webReferencesItem); |
||||||
//
|
|
||||||
// // Web reference url.
|
// Web reference url.
|
||||||
// WebReferenceUrl webReferenceUrl = new WebReferenceUrl(project);
|
WebReferenceUrl webReferenceUrl = new WebReferenceUrl(project); |
||||||
// webReferenceUrl.Include = "http://localhost/test.asmx";
|
webReferenceUrl.Include = "http://localhost/test.asmx"; |
||||||
// webReferenceUrl.UpdateFromURL = "http://localhost/test.asmx";
|
webReferenceUrl.UpdateFromURL = "http://localhost/test.asmx"; |
||||||
// webReferenceUrl.RelPath = "Web References\\localhost";
|
webReferenceUrl.RelPath = "Web References\\localhost"; |
||||||
// ProjectService.AddProjectItem(project, webReferenceUrl);
|
ProjectService.AddProjectItem(project, webReferenceUrl); |
||||||
//
|
|
||||||
// FileProjectItem discoFileItem = new FileProjectItem(project, ItemType.None);
|
FileProjectItem discoFileItem = new FileProjectItem(project, ItemType.None); |
||||||
// discoFileItem.Include = "Web References\\localhost\\test.disco";
|
discoFileItem.Include = "Web References\\localhost\\test.disco"; |
||||||
// ProjectService.AddProjectItem(project, discoFileItem);
|
ProjectService.AddProjectItem(project, discoFileItem); |
||||||
//
|
|
||||||
// FileProjectItem wsdlFileItem = new FileProjectItem(project, ItemType.None);
|
FileProjectItem wsdlFileItem = new FileProjectItem(project, ItemType.None); |
||||||
// wsdlFileItem.Include = "Web References\\localhost\\test.wsdl";
|
wsdlFileItem.Include = "Web References\\localhost\\test.wsdl"; |
||||||
// ProjectService.AddProjectItem(project, wsdlFileItem);
|
ProjectService.AddProjectItem(project, wsdlFileItem); |
||||||
//
|
|
||||||
// // Proxy
|
// Proxy
|
||||||
// FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile);
|
FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile); |
||||||
// proxyItem.Include = "Web References\\localhost\\Reference.cs";
|
proxyItem.Include = "Web References\\localhost\\Reference.cs"; |
||||||
// proxyItem.DependentUpon = "Reference.map";
|
proxyItem.DependentUpon = "Reference.map"; |
||||||
// ProjectService.AddProjectItem(project, proxyItem);
|
ProjectService.AddProjectItem(project, proxyItem); |
||||||
//
|
|
||||||
// // Reference map.
|
// Reference map.
|
||||||
// FileProjectItem mapItem = new FileProjectItem(project, ItemType.None);
|
FileProjectItem mapItem = new FileProjectItem(project, ItemType.None); |
||||||
// mapItem.Include = "Web References\\localhost\\Reference.map";
|
mapItem.Include = "Web References\\localhost\\Reference.map"; |
||||||
// ProjectService.AddProjectItem(project, mapItem);
|
ProjectService.AddProjectItem(project, mapItem); |
||||||
//
|
|
||||||
// // System.Web.Services reference.
|
// System.Web.Services reference.
|
||||||
// ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services");
|
ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services"); |
||||||
// ProjectService.AddProjectItem(project, webServicesReferenceItem);
|
ProjectService.AddProjectItem(project, webServicesReferenceItem); |
||||||
//
|
|
||||||
// projectItems = WebReference.GetFileItems(project, "localhost");
|
projectItems = WebReference.GetFileItems(project, "localhost"); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void ReferenceMapFileItemFound()
|
public void ReferenceMapFileItemFound() |
||||||
// {
|
{ |
||||||
// Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\Reference.map", ItemType.None));
|
Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\Reference.map", ItemType.None)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void ProxyFileItemFound()
|
public void ProxyFileItemFound() |
||||||
// {
|
{ |
||||||
// Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\Reference.cs", ItemType.Compile));
|
Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\Reference.cs", ItemType.Compile)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void WsdlFileItemFound()
|
public void WsdlFileItemFound() |
||||||
// {
|
{ |
||||||
// Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\test.wsdl", ItemType.None));
|
Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\test.wsdl", ItemType.None)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void DiscoFileItemFound()
|
public void DiscoFileItemFound() |
||||||
// {
|
{ |
||||||
// Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\test.disco", ItemType.None));
|
Assert.IsNotNull(WebReferenceTestHelper.GetProjectItem(projectItems, "Web References\\localhost\\test.disco", ItemType.None)); |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
} |
||||||
|
|||||||
@ -1,62 +1,61 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using ICSharpCode.Core; |
||||||
//using ICSharpCode.Core;
|
using ICSharpCode.SharpDevelop; |
||||||
//using ICSharpCode.SharpDevelop;
|
using SD = ICSharpCode.SharpDevelop.Gui; |
||||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using NUnit.Framework; |
||||||
//using NUnit.Framework;
|
using System; |
||||||
//using System;
|
using System.IO; |
||||||
//using System.IO;
|
using System.Collections.Generic; |
||||||
//using System.Collections.Generic;
|
using System.Web.Services.Description; |
||||||
//using System.Web.Services.Description;
|
using System.Web.Services.Discovery; |
||||||
//using System.Web.Services.Discovery;
|
|
||||||
//
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
{ |
||||||
//{
|
/// <summary>
|
||||||
// /// <summary>
|
/// Non-standard web references folder name.
|
||||||
// /// Non-standard web references folder name.
|
/// </summary>
|
||||||
// /// </summary>
|
[TestFixture] |
||||||
// [TestFixture]
|
public class RenamedWebReferencesFolderTest : SDTestFixtureBase |
||||||
// public class RenamedWebReferencesFolderTest
|
{ |
||||||
// {
|
Gui.WebReference webReference; |
||||||
// SD.WebReference webReference;
|
DiscoveryClientProtocol protocol; |
||||||
// DiscoveryClientProtocol protocol;
|
MSBuildBasedProject project; |
||||||
// MSBuildBasedProject project;
|
WebReferenceUrl webReferenceUrl; |
||||||
// WebReferenceUrl webReferenceUrl;
|
|
||||||
//
|
string name = "localhost"; |
||||||
// string name = "localhost";
|
string proxyNamespace = "WebReferenceNamespace"; |
||||||
// string proxyNamespace = "WebReferenceNamespace";
|
string updateFromUrl = "http://localhost/test.asmx"; |
||||||
// string updateFromUrl = "http://localhost/test.asmx";
|
|
||||||
//
|
public override void FixtureSetUp() |
||||||
// [TestFixtureSetUp]
|
{ |
||||||
// public void SetupFixture()
|
base.FixtureSetUp(); |
||||||
// {
|
project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project = WebReferenceTestHelper.CreateTestProject("C#");
|
project.FileName = FileName.Create("C:\\Projects\\Web.csproj"); |
||||||
// project.FileName = "C:\\Projects\\Web.csproj";
|
WebReferencesProjectItem item = new WebReferencesProjectItem(project); |
||||||
// WebReferencesProjectItem item = new WebReferencesProjectItem(project);
|
item.Include = "Foo\\"; |
||||||
// item.Include = "Foo\\";
|
ProjectService.AddProjectItem(project, item); |
||||||
// ProjectService.AddProjectItem(project, item);
|
|
||||||
//
|
protocol = new DiscoveryClientProtocol(); |
||||||
// protocol = new DiscoveryClientProtocol();
|
|
||||||
//
|
WebReferenceTestHelper.InitializeProjectBindings(); |
||||||
// WebReferenceTestHelper.InitializeProjectBindings();
|
|
||||||
//
|
webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); |
||||||
// webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
|
webReferenceUrl = (WebReferenceUrl)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.WebReferenceUrl); |
||||||
// webReferenceUrl = (WebReferenceUrl)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.WebReferenceUrl);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void WebReferenceRelativePath() |
||||||
// public void WebReferenceRelativePath()
|
{ |
||||||
// {
|
Assert.AreEqual("Foo\\localhost", webReferenceUrl.RelPath); |
||||||
// Assert.AreEqual("Foo\\localhost", webReferenceUrl.RelPath);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void WebReferencesFolder() |
||||||
// public void WebReferencesFolder()
|
{ |
||||||
// {
|
Assert.AreEqual("C:\\Projects\\Foo", webReference.WebReferencesDirectory); |
||||||
// Assert.AreEqual("C:\\Projects\\Foo", webReference.WebReferencesDirectory);
|
} |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
|
||||||
|
|||||||
@ -1,63 +1,62 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using ICSharpCode.SharpDevelop; |
||||||
//using ICSharpCode.SharpDevelop;
|
using SD = ICSharpCode.SharpDevelop.Gui; |
||||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using NUnit.Framework; |
||||||
//using NUnit.Framework;
|
using System; |
||||||
//using System;
|
using System.IO; |
||||||
//using System.IO;
|
using System.Collections.Generic; |
||||||
//using System.Collections.Generic;
|
using System.Web.Services.Description; |
||||||
//using System.Web.Services.Description;
|
using System.Web.Services.Discovery; |
||||||
//using System.Web.Services.Discovery;
|
|
||||||
//
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
{ |
||||||
//{
|
/// <summary>
|
||||||
// /// <summary>
|
/// Tests that the generated filename ends with .vb if the project is
|
||||||
// /// Tests that the generated filename ends with .vb if the project is
|
/// a vb project.
|
||||||
// /// a vb project.
|
/// </summary>
|
||||||
// /// </summary>
|
[TestFixture] |
||||||
// [TestFixture]
|
public class VBNetWebReferenceTest : SDTestFixtureBase |
||||||
// public class VBNetWebReferenceTest
|
{ |
||||||
// {
|
Gui.WebReference webReference; |
||||||
// SD.WebReference webReference;
|
DiscoveryClientProtocol protocol; |
||||||
// DiscoveryClientProtocol protocol;
|
FileProjectItem proxyFileProjectItem; |
||||||
// FileProjectItem proxyFileProjectItem;
|
MSBuildBasedProject project; |
||||||
// MSBuildBasedProject project;
|
|
||||||
//
|
string name = "localhost"; |
||||||
// string name = "localhost";
|
string proxyNamespace = "WebReferenceNamespace"; |
||||||
// string proxyNamespace = "WebReferenceNamespace";
|
string updateFromUrl = "http://localhost/test.asmx"; |
||||||
// string updateFromUrl = "http://localhost/test.asmx";
|
|
||||||
//
|
public override void FixtureSetUp() |
||||||
// [TestFixtureSetUp]
|
{ |
||||||
// public void SetUpFixture()
|
base.FixtureSetUp(); |
||||||
// {
|
project = WebReferenceTestHelper.CreateTestProject("VBNet"); |
||||||
// project = WebReferenceTestHelper.CreateTestProject("VBNet");
|
|
||||||
//
|
protocol = new DiscoveryClientProtocol(); |
||||||
// protocol = new DiscoveryClientProtocol();
|
DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); |
||||||
// DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
|
discoveryRef.Url = updateFromUrl; |
||||||
// discoveryRef.Url = updateFromUrl;
|
protocol.References.Add(discoveryRef); |
||||||
// protocol.References.Add(discoveryRef);
|
|
||||||
//
|
ContractReference contractRef = new ContractReference(); |
||||||
// ContractReference contractRef = new ContractReference();
|
contractRef.Url = "http://localhost/test.asmx?wsdl"; |
||||||
// contractRef.Url = "http://localhost/test.asmx?wsdl";
|
contractRef.ClientProtocol = new DiscoveryClientProtocol(); |
||||||
// contractRef.ClientProtocol = new DiscoveryClientProtocol();
|
ServiceDescription desc = new ServiceDescription(); |
||||||
// ServiceDescription desc = new ServiceDescription();
|
contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); |
||||||
// contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
|
protocol.References.Add(contractRef); |
||||||
// protocol.References.Add(contractRef);
|
|
||||||
//
|
WebReferenceTestHelper.InitializeProjectBindings(); |
||||||
// WebReferenceTestHelper.InitializeProjectBindings();
|
|
||||||
//
|
webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); |
||||||
// webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
|
|
||||||
//
|
proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.vb", ItemType.Compile); |
||||||
// proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost\\Reference.vb", ItemType.Compile);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void VBProxyFileExists() |
||||||
// public void VBProxyFileExists()
|
{ |
||||||
// {
|
Assert.IsNotNull(proxyFileProjectItem); |
||||||
// Assert.IsNotNull(proxyFileProjectItem);
|
} |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
|
||||||
|
|||||||
@ -1,125 +1,125 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using ICSharpCode.Core; |
||||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using NUnit.Framework;
|
using NUnit.Framework; |
||||||
//using System;
|
using System; |
||||||
//using System.Web.Services.Description;
|
using System.Web.Services.Description; |
||||||
//using System.Web.Services.Discovery;
|
using System.Web.Services.Discovery; |
||||||
//
|
|
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//{
|
{ |
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// Tests the WebReferenceChanges class.
|
/// Tests the WebReferenceChanges class.
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// [TestFixture]
|
[TestFixture] |
||||||
// public class WebReferenceChangesTest
|
public class WebReferenceChangesTest : SDTestFixtureBase |
||||||
// {
|
{ |
||||||
// SD.WebReferenceChanges changes;
|
WebReferenceChanges changes; |
||||||
//
|
|
||||||
// [TestFixtureSetUp]
|
public override void FixtureSetUp() |
||||||
// public void SetUpFixture()
|
{ |
||||||
// {
|
base.FixtureSetUp(); |
||||||
// // Set up the project.
|
// Set up the project.
|
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||||
//
|
|
||||||
// // Web references item.
|
// Web references item.
|
||||||
// WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project);
|
WebReferencesProjectItem webReferencesItem = new WebReferencesProjectItem(project); |
||||||
// webReferencesItem.Include = "Web References\\";
|
webReferencesItem.Include = "Web References\\"; |
||||||
// ProjectService.AddProjectItem(project, webReferencesItem);
|
ProjectService.AddProjectItem(project, webReferencesItem); |
||||||
//
|
|
||||||
// // Web reference url.
|
// Web reference url.
|
||||||
// WebReferenceUrl webReferenceUrl = new WebReferenceUrl(project);
|
WebReferenceUrl webReferenceUrl = new WebReferenceUrl(project); |
||||||
// webReferenceUrl.Include = "http://localhost/test.asmx";
|
webReferenceUrl.Include = "http://localhost/test.asmx"; |
||||||
// webReferenceUrl.UpdateFromURL = "http://localhost/test.asmx";
|
webReferenceUrl.UpdateFromURL = "http://localhost/test.asmx"; |
||||||
// webReferenceUrl.RelPath = "Web References\\localhost";
|
webReferenceUrl.RelPath = "Web References\\localhost"; |
||||||
// ProjectService.AddProjectItem(project, webReferenceUrl);
|
ProjectService.AddProjectItem(project, webReferenceUrl); |
||||||
//
|
|
||||||
// FileProjectItem discoFileItem = new FileProjectItem(project, ItemType.None);
|
FileProjectItem discoFileItem = new FileProjectItem(project, ItemType.None); |
||||||
// discoFileItem.Include = "Web References\\localhost\\test.disco";
|
discoFileItem.Include = "Web References\\localhost\\test.disco"; |
||||||
// ProjectService.AddProjectItem(project, discoFileItem);
|
ProjectService.AddProjectItem(project, discoFileItem); |
||||||
//
|
|
||||||
// FileProjectItem wsdlFileItem = new FileProjectItem(project, ItemType.None);
|
FileProjectItem wsdlFileItem = new FileProjectItem(project, ItemType.None); |
||||||
// wsdlFileItem.Include = "Web References\\localhost\\test.wsdl";
|
wsdlFileItem.Include = "Web References\\localhost\\test.wsdl"; |
||||||
// ProjectService.AddProjectItem(project, wsdlFileItem);
|
ProjectService.AddProjectItem(project, wsdlFileItem); |
||||||
//
|
|
||||||
// // Proxy
|
// Proxy
|
||||||
// FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile);
|
FileProjectItem proxyItem = new FileProjectItem(project, ItemType.Compile); |
||||||
// proxyItem.Include = "Web References\\localhost\\Reference.cs";
|
proxyItem.Include = "Web References\\localhost\\Reference.cs"; |
||||||
// proxyItem.DependentUpon = "Reference.map";
|
proxyItem.DependentUpon = "Reference.map"; |
||||||
// ProjectService.AddProjectItem(project, proxyItem);
|
ProjectService.AddProjectItem(project, proxyItem); |
||||||
//
|
|
||||||
// // Reference map.
|
// Reference map.
|
||||||
// FileProjectItem mapItem = new FileProjectItem(project, ItemType.None);
|
FileProjectItem mapItem = new FileProjectItem(project, ItemType.None); |
||||||
// mapItem.Include = "Web References\\localhost\\Reference.map";
|
mapItem.Include = "Web References\\localhost\\Reference.map"; |
||||||
// ProjectService.AddProjectItem(project, mapItem);
|
ProjectService.AddProjectItem(project, mapItem); |
||||||
//
|
|
||||||
// // System.Web.Services reference.
|
// System.Web.Services reference.
|
||||||
// ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services");
|
ReferenceProjectItem webServicesReferenceItem = new ReferenceProjectItem(project, "System.Web.Services"); |
||||||
// ProjectService.AddProjectItem(project, webServicesReferenceItem);
|
ProjectService.AddProjectItem(project, webServicesReferenceItem); |
||||||
//
|
|
||||||
// // Set up the web reference.
|
// Set up the web reference.
|
||||||
// DiscoveryClientProtocol protocol = new DiscoveryClientProtocol();
|
DiscoveryClientProtocol protocol = new DiscoveryClientProtocol(); |
||||||
// DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
|
DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); |
||||||
// discoveryRef.Url = "http://localhost/new.asmx";
|
discoveryRef.Url = "http://localhost/new.asmx"; |
||||||
// protocol.References.Add(discoveryRef);
|
protocol.References.Add(discoveryRef); |
||||||
//
|
|
||||||
// ContractReference contractRef = new ContractReference();
|
ContractReference contractRef = new ContractReference(); |
||||||
// contractRef.Url = "http://localhost/new.asmx?wsdl";
|
contractRef.Url = "http://localhost/new.asmx?wsdl"; |
||||||
// contractRef.ClientProtocol = new DiscoveryClientProtocol();
|
contractRef.ClientProtocol = new DiscoveryClientProtocol(); |
||||||
// ServiceDescription desc = new ServiceDescription();
|
ServiceDescription desc = new ServiceDescription(); |
||||||
// contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
|
contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); |
||||||
// protocol.References.Add(contractRef);
|
protocol.References.Add(contractRef); |
||||||
//
|
|
||||||
// WebReferenceTestHelper.InitializeProjectBindings();
|
WebReferenceTestHelper.InitializeProjectBindings(); |
||||||
//
|
|
||||||
// SD.WebReference webReference = new SD.WebReference(project, "http://localhost/new.asmx", "localhost", "ProxyNamespace", protocol);
|
var webReference = new Gui.WebReference(project, "http://localhost/new.asmx", "localhost", "ProxyNamespace", protocol); |
||||||
// changes = webReference.GetChanges(project);
|
changes = webReference.GetChanges(project); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void HasChanged()
|
public void HasChanged() |
||||||
// {
|
{ |
||||||
// Assert.IsTrue(changes.Changed);
|
Assert.IsTrue(changes.Changed); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void HasNewWsdlFile()
|
public void HasNewWsdlFile() |
||||||
// {
|
{ |
||||||
// Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.NewItems, "Web References\\localhost\\new.wsdl", ItemType.None));
|
Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.NewItems, "Web References\\localhost\\new.wsdl", ItemType.None)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void HasNewDiscoFile()
|
public void HasNewDiscoFile() |
||||||
// {
|
{ |
||||||
// Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.NewItems, "Web References\\localhost\\new.disco", ItemType.None));
|
Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.NewItems, "Web References\\localhost\\new.disco", ItemType.None)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void OldWsdlFileRemoved()
|
public void OldWsdlFileRemoved() |
||||||
// {
|
{ |
||||||
// Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.ItemsRemoved, "Web References\\localhost\\test.wsdl", ItemType.None));
|
Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.ItemsRemoved, "Web References\\localhost\\test.wsdl", ItemType.None)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void OldDiscoFileRemoved()
|
public void OldDiscoFileRemoved() |
||||||
// {
|
{ |
||||||
// Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.ItemsRemoved, "Web References\\localhost\\test.disco", ItemType.None));
|
Assert.IsNotNull(WebReferenceTestHelper.GetFileProjectItem(changes.ItemsRemoved, "Web References\\localhost\\test.disco", ItemType.None)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void WebReferenceUrlNotConsideredNewItem()
|
public void WebReferenceUrlNotConsideredNewItem() |
||||||
// {
|
{ |
||||||
// Assert.IsNull(WebReferenceTestHelper.GetProjectItem(changes.NewItems, ItemType.WebReferenceUrl));
|
Assert.IsNull(WebReferenceTestHelper.GetProjectItem(changes.NewItems, ItemType.WebReferenceUrl)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void WebReferenceUrlNotConsideredRemoved()
|
public void WebReferenceUrlNotConsideredRemoved() |
||||||
// {
|
{ |
||||||
// Assert.IsNull(WebReferenceTestHelper.GetProjectItem(changes.ItemsRemoved, ItemType.WebReferenceUrl));
|
Assert.IsNull(WebReferenceTestHelper.GetProjectItem(changes.ItemsRemoved, ItemType.WebReferenceUrl)); |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
} |
||||||
|
|||||||
@ -1,125 +1,124 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using ICSharpCode.Core; |
||||||
//using ICSharpCode.Core;
|
using ICSharpCode.SharpDevelop; |
||||||
//using ICSharpCode.SharpDevelop;
|
using SD = ICSharpCode.SharpDevelop.Gui; |
||||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using NUnit.Framework; |
||||||
//using NUnit.Framework;
|
using System; |
||||||
//using System;
|
using System.IO; |
||||||
//using System.IO;
|
using System.Collections.Generic; |
||||||
//using System.Collections.Generic;
|
using System.Web.Services.Description; |
||||||
//using System.Web.Services.Description;
|
using System.Web.Services.Discovery; |
||||||
//using System.Web.Services.Discovery;
|
|
||||||
//
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
{ |
||||||
//{
|
/// <summary>
|
||||||
// /// <summary>
|
/// Checks that the web reference folder name is changed if
|
||||||
// /// Checks that the web reference folder name is changed if
|
/// one exists with the same name.
|
||||||
// /// one exists with the same name.
|
/// </summary>
|
||||||
// /// </summary>
|
[TestFixture] |
||||||
// [TestFixture]
|
public class WebReferenceFolderAlreadyExistsTest : SDTestFixtureBase |
||||||
// public class WebReferenceFolderAlreadyExistsTest
|
{ |
||||||
// {
|
Gui.WebReference webReference; |
||||||
// SD.WebReference webReference;
|
DiscoveryClientProtocol protocol; |
||||||
// DiscoveryClientProtocol protocol;
|
MSBuildBasedProject project; |
||||||
// MSBuildBasedProject project;
|
WebReferenceUrl webReferenceUrl; |
||||||
// WebReferenceUrl webReferenceUrl;
|
FileProjectItem discoFileProjectItem; |
||||||
// FileProjectItem discoFileProjectItem;
|
FileProjectItem referenceMapFileProjectItem; |
||||||
// FileProjectItem referenceMapFileProjectItem;
|
FileProjectItem wsdlFileProjectItem; |
||||||
// FileProjectItem wsdlFileProjectItem;
|
FileProjectItem proxyFileProjectItem; |
||||||
// FileProjectItem proxyFileProjectItem;
|
|
||||||
//
|
string oldName = "localhost"; |
||||||
// string oldName = "localhost";
|
string name = "localhost1"; |
||||||
// string name = "localhost1";
|
string proxyNamespace = "WebReferenceNamespace"; |
||||||
// string proxyNamespace = "WebReferenceNamespace";
|
string updateFromUrl = "http://localhost/test.asmx"; |
||||||
// string updateFromUrl = "http://localhost/test.asmx";
|
|
||||||
//
|
public override void FixtureSetUp() |
||||||
// [TestFixtureSetUp]
|
{ |
||||||
// public void SetupFixture()
|
base.FixtureSetUp(); |
||||||
// {
|
project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project = WebReferenceTestHelper.CreateTestProject("C#");
|
project.FileName = FileName.Create("C:\\Projects\\Web.csproj"); |
||||||
// project.FileName = "C:\\Projects\\Web.csproj";
|
WebReferencesProjectItem item = new WebReferencesProjectItem(project); |
||||||
// WebReferencesProjectItem item = new WebReferencesProjectItem(project);
|
item.Include = "Web References\\"; |
||||||
// item.Include = "Web References\\";
|
ProjectService.AddProjectItem(project, item); |
||||||
// ProjectService.AddProjectItem(project, item);
|
|
||||||
//
|
protocol = new DiscoveryClientProtocol(); |
||||||
// protocol = new DiscoveryClientProtocol();
|
DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); |
||||||
// DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
|
discoveryRef.Url = updateFromUrl; |
||||||
// discoveryRef.Url = updateFromUrl;
|
protocol.References.Add(discoveryRef); |
||||||
// protocol.References.Add(discoveryRef);
|
|
||||||
//
|
ContractReference contractRef = new ContractReference(); |
||||||
// ContractReference contractRef = new ContractReference();
|
contractRef.Url = "http://localhost/test.asmx?wsdl"; |
||||||
// contractRef.Url = "http://localhost/test.asmx?wsdl";
|
contractRef.ClientProtocol = new DiscoveryClientProtocol(); |
||||||
// contractRef.ClientProtocol = new DiscoveryClientProtocol();
|
ServiceDescription desc = new ServiceDescription(); |
||||||
// ServiceDescription desc = new ServiceDescription();
|
contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); |
||||||
// contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
|
protocol.References.Add(contractRef); |
||||||
// protocol.References.Add(contractRef);
|
|
||||||
//
|
WebReferenceTestHelper.InitializeProjectBindings(); |
||||||
// WebReferenceTestHelper.InitializeProjectBindings();
|
|
||||||
//
|
webReference = new Gui.WebReference(project, updateFromUrl, oldName, proxyNamespace, protocol); |
||||||
// webReference = new SD.WebReference(project, updateFromUrl, oldName, proxyNamespace, protocol);
|
|
||||||
//
|
// Force generation of items.
|
||||||
// // Force generation of items.
|
List<ProjectItem> items = webReference.Items; |
||||||
// List<ProjectItem> items = webReference.Items;
|
|
||||||
//
|
// Change the web reference name.
|
||||||
// // Change the web reference name.
|
webReference.Name = name; |
||||||
// webReference.Name = name;
|
webReferenceUrl = (WebReferenceUrl)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.WebReferenceUrl); |
||||||
// webReferenceUrl = (WebReferenceUrl)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.WebReferenceUrl);
|
|
||||||
//
|
discoFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\test.disco", ItemType.None); |
||||||
// discoFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\test.disco", ItemType.None);
|
referenceMapFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\Reference.map", 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); |
||||||
// wsdlFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\test.wsdl", ItemType.None);
|
proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\Reference.cs", ItemType.Compile); |
||||||
// proxyFileProjectItem = WebReferenceTestHelper.GetFileProjectItem(webReference.Items, "Web References\\localhost1\\Reference.cs", ItemType.Compile);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void WebReferenceRelativePath() |
||||||
// public void WebReferenceRelativePath()
|
{ |
||||||
// {
|
Assert.AreEqual("Web References\\localhost1", webReferenceUrl.RelPath); |
||||||
// Assert.AreEqual("Web References\\localhost1", webReferenceUrl.RelPath);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void WebReferenceName() |
||||||
// public void WebReferenceName()
|
{ |
||||||
// {
|
Assert.AreEqual(name, webReference.Name); |
||||||
// Assert.AreEqual(name, webReference.Name);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void WebReferenceDirectory() |
||||||
// public void WebReferenceDirectory()
|
{ |
||||||
// {
|
Assert.AreEqual(Path.Combine(project.Directory, "Web References\\localhost1"), webReference.Directory); |
||||||
// Assert.AreEqual(Path.Combine(project.Directory, "Web References\\localhost1"), webReference.Directory);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void ProxyFileName() |
||||||
// public void ProxyFileName()
|
{ |
||||||
// {
|
Assert.AreEqual("C:\\Projects\\Web References\\localhost1\\Reference.cs", webReference.WebProxyFileName); |
||||||
// Assert.AreEqual("C:\\Projects\\Web References\\localhost1\\Reference.cs", webReference.WebProxyFileName);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void DiscoFileItemExists() |
||||||
// public void DiscoFileItemExists()
|
{ |
||||||
// {
|
Assert.IsNotNull(discoFileProjectItem); |
||||||
// Assert.IsNotNull(discoFileProjectItem);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void WsdlFileItemExists() |
||||||
// public void WsdlFileItemExists()
|
{ |
||||||
// {
|
Assert.IsNotNull(wsdlFileProjectItem); |
||||||
// Assert.IsNotNull(wsdlFileProjectItem);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void ReferenceMapFileItemExists() |
||||||
// public void ReferenceMapFileItemExists()
|
{ |
||||||
// {
|
Assert.IsNotNull(referenceMapFileProjectItem); |
||||||
// Assert.IsNotNull(referenceMapFileProjectItem);
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void ProxyFileItemExists() |
||||||
// public void ProxyFileItemExists()
|
{ |
||||||
// {
|
Assert.IsNotNull(proxyFileProjectItem); |
||||||
// Assert.IsNotNull(proxyFileProjectItem);
|
} |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
|
||||||
|
|||||||
@ -1,68 +1,67 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using ICSharpCode.Core; |
||||||
//using ICSharpCode.SharpDevelop;
|
using ICSharpCode.SharpDevelop; |
||||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using NUnit.Framework; |
||||||
//using NUnit.Framework;
|
using System; |
||||||
//using System;
|
using System.IO; |
||||||
//using System.IO;
|
using System.Collections.Generic; |
||||||
//using System.Collections.Generic;
|
using System.Web.Services.Description; |
||||||
//using System.Web.Services.Description;
|
using System.Web.Services.Discovery; |
||||||
//using System.Web.Services.Discovery;
|
|
||||||
//
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
{ |
||||||
//{
|
/// <summary>
|
||||||
// /// <summary>
|
/// Tests the generated items are not changed if the items have been
|
||||||
// /// Tests the generated items are not changed if the items have been
|
/// added to the project. Previously a WebReferencesProjectItem would be
|
||||||
// /// added to the project. Previously a WebReferencesProjectItem would be
|
/// missing after the items have been added to the project.
|
||||||
// /// missing after the items have been added to the project.
|
/// </summary>
|
||||||
// /// </summary>
|
[TestFixture] |
||||||
// [TestFixture]
|
public class WebReferenceProjectItemsCachedTest : SDTestFixtureBase |
||||||
// public class WebReferenceProjectItemsCachedTest
|
{ |
||||||
// {
|
Gui.WebReference webReference; |
||||||
// SD.WebReference webReference;
|
DiscoveryClientProtocol protocol; |
||||||
// DiscoveryClientProtocol protocol;
|
WebReferencesProjectItem webReferencesProjectItem; |
||||||
// WebReferencesProjectItem webReferencesProjectItem;
|
MSBuildBasedProject project; |
||||||
// MSBuildBasedProject project;
|
|
||||||
//
|
string name = "localhost"; |
||||||
// string name = "localhost";
|
string proxyNamespace = "WebReferenceNamespace"; |
||||||
// string proxyNamespace = "WebReferenceNamespace";
|
string updateFromUrl = "http://localhost/test.asmx"; |
||||||
// string updateFromUrl = "http://localhost/test.asmx";
|
|
||||||
//
|
public override void FixtureSetUp() |
||||||
// [TestFixtureSetUp]
|
{ |
||||||
// public void SetUpFixture()
|
base.FixtureSetUp(); |
||||||
// {
|
project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project = WebReferenceTestHelper.CreateTestProject("C#");
|
project.FileName = FileName.Create("C:\\projects\\test\\foo.csproj"); |
||||||
// project.FileName = "C:\\projects\\test\\foo.csproj";
|
|
||||||
//
|
protocol = new DiscoveryClientProtocol(); |
||||||
// protocol = new DiscoveryClientProtocol();
|
DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); |
||||||
// DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
|
discoveryRef.Url = updateFromUrl; |
||||||
// discoveryRef.Url = updateFromUrl;
|
protocol.References.Add(discoveryRef); |
||||||
// protocol.References.Add(discoveryRef);
|
|
||||||
//
|
ContractReference contractRef = new ContractReference(); |
||||||
// ContractReference contractRef = new ContractReference();
|
contractRef.Url = "http://localhost/test.asmx?wsdl"; |
||||||
// contractRef.Url = "http://localhost/test.asmx?wsdl";
|
contractRef.ClientProtocol = new DiscoveryClientProtocol(); |
||||||
// contractRef.ClientProtocol = new DiscoveryClientProtocol();
|
ServiceDescription desc = new ServiceDescription(); |
||||||
// ServiceDescription desc = new ServiceDescription();
|
contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); |
||||||
// contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
|
protocol.References.Add(contractRef); |
||||||
// protocol.References.Add(contractRef);
|
|
||||||
//
|
WebReferenceTestHelper.InitializeProjectBindings(); |
||||||
// WebReferenceTestHelper.InitializeProjectBindings();
|
|
||||||
//
|
webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); |
||||||
// webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
|
|
||||||
//
|
foreach (ProjectItem item in webReference.Items) { |
||||||
// foreach (ProjectItem item in webReference.Items) {
|
ProjectService.AddProjectItem(project, item); |
||||||
// ProjectService.AddProjectItem(project, item);
|
} |
||||||
// }
|
webReferencesProjectItem = webReference.WebReferencesProjectItem; |
||||||
// webReferencesProjectItem = webReference.WebReferencesProjectItem;
|
} |
||||||
// }
|
|
||||||
//
|
[Test] |
||||||
// [Test]
|
public void WebReferencesProjectItemExists() |
||||||
// public void WebReferencesProjectItemExists()
|
{ |
||||||
// {
|
Assert.IsNotNull(webReferencesProjectItem); |
||||||
// Assert.IsNotNull(webReferencesProjectItem);
|
} |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
|
||||||
|
|||||||
@ -1,78 +1,78 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using ICSharpCode.Core; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using NUnit.Framework;
|
using NUnit.Framework; |
||||||
//using System;
|
using System; |
||||||
//using System.IO;
|
using System.IO; |
||||||
//
|
|
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//{
|
{ |
||||||
// [TestFixture]
|
[TestFixture] |
||||||
// public class WebReferenceUrlTests
|
public class WebReferenceUrlTests : SDTestFixtureBase |
||||||
// {
|
{ |
||||||
// [Test]
|
[Test] |
||||||
// public void FileName()
|
public void FileNameTest() |
||||||
// {
|
{ |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
WebReferenceUrl url = new WebReferenceUrl(project); |
||||||
// url.RelPath = "Web References\\localhost";
|
url.RelPath = "Web References\\localhost"; |
||||||
// url.Include = "http://localhost/test.asmx";
|
url.Include = "http://localhost/test.asmx"; |
||||||
//
|
|
||||||
// Assert.AreEqual(Path.Combine(project.Directory, url.RelPath), url.FileName);
|
Assert.AreEqual(project.Directory.CombineFile(url.RelPath), url.FileName); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void RelPathEndsWithSlash()
|
public void RelPathEndsWithSlash() |
||||||
// {
|
{ |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
WebReferenceUrl url = new WebReferenceUrl(project); |
||||||
// url.RelPath = "Web References\\localhost\\";
|
url.RelPath = "Web References\\localhost\\"; |
||||||
// url.Include = "http://localhost/test.asmx";
|
url.Include = "http://localhost/test.asmx"; |
||||||
//
|
|
||||||
// Assert.AreEqual(Path.Combine(project.Directory, url.RelPath.Trim('\\')), url.FileName);
|
Assert.AreEqual(project.Directory.CombineFile(url.RelPath.Trim('\\')), url.FileName); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void ChangeFileName()
|
public void ChangeFileName() |
||||||
// {
|
{ |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
WebReferenceUrl url = new WebReferenceUrl(project); |
||||||
// url.RelPath = "Web References\\localhost";
|
url.RelPath = "Web References\\localhost"; |
||||||
// url.Include = "http://localhost/test.asmx";
|
url.Include = "http://localhost/test.asmx"; |
||||||
//
|
|
||||||
// // Change filename - simulate a folder rename.
|
// Change filename - simulate a folder rename.
|
||||||
// url.FileName = "c:\\projects\\test\\Web References\\mywebservice";
|
url.FileName = FileName.Create("c:\\projects\\test\\Web References\\mywebservice"); |
||||||
//
|
|
||||||
// Assert.AreEqual("http://localhost/test.asmx", url.Include);
|
Assert.AreEqual("http://localhost/test.asmx", url.Include); |
||||||
// Assert.AreEqual("Web References\\mywebservice", url.RelPath);
|
Assert.AreEqual("Web References\\mywebservice", url.RelPath); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void NoNamespaceSpecified()
|
public void NoNamespaceSpecified() |
||||||
// {
|
{ |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||||
// project.RootNamespace = "TestRootNamespace";
|
project.RootNamespace = "TestRootNamespace"; |
||||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
WebReferenceUrl url = new WebReferenceUrl(project); |
||||||
//
|
|
||||||
// Assert.AreEqual("TestRootNamespace", url.Namespace);
|
Assert.AreEqual("TestRootNamespace", url.Namespace); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void NamespaceSpecified()
|
public void NamespaceSpecified() |
||||||
// {
|
{ |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project.FileName = "c:\\projects\\test\\foo.csproj";
|
project.FileName = FileName.Create("c:\\projects\\test\\foo.csproj"); |
||||||
// project.RootNamespace = "TestRootNamespace";
|
project.RootNamespace = "TestRootNamespace"; |
||||||
// WebReferenceUrl url = new WebReferenceUrl(project);
|
WebReferenceUrl url = new WebReferenceUrl(project); |
||||||
// url.Namespace = "WebReferenceNamespace";
|
url.Namespace = "WebReferenceNamespace"; |
||||||
//
|
|
||||||
// Assert.AreEqual("WebReferenceNamespace", url.Namespace);
|
Assert.AreEqual("WebReferenceNamespace", url.Namespace); |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
} |
||||||
|
|||||||
@ -1,96 +1,96 @@ |
|||||||
#warning
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
//// 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)
|
||||||
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
//
|
using ICSharpCode.Core; |
||||||
//using ICSharpCode.SharpDevelop;
|
using ICSharpCode.SharpDevelop; |
||||||
//using SD = ICSharpCode.SharpDevelop.Gui;
|
using SD = ICSharpCode.SharpDevelop.Gui; |
||||||
//using ICSharpCode.SharpDevelop.Project;
|
using ICSharpCode.SharpDevelop.Project; |
||||||
//using NUnit.Framework;
|
using NUnit.Framework; |
||||||
//using System;
|
using System; |
||||||
//using System.IO;
|
using System.IO; |
||||||
//using System.Collections.Generic;
|
using System.Collections.Generic; |
||||||
//using System.Web.Services.Description;
|
using System.Web.Services.Description; |
||||||
//using System.Web.Services.Discovery;
|
using System.Web.Services.Discovery; |
||||||
//
|
|
||||||
//namespace ICSharpCode.SharpDevelop.Tests.WebReferences
|
namespace ICSharpCode.SharpDevelop.Tests.WebReferences |
||||||
//{
|
{ |
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// Tests that the generated project items for a web reference do not include
|
/// 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.
|
/// a reference to System.Web.Services if one already exists in the project.
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// [TestFixture]
|
[TestFixture] |
||||||
// public class WebServicesReferenceExistsTest
|
public class WebServicesReferenceExistsTest : SDTestFixtureBase |
||||||
// {
|
{ |
||||||
// SD.WebReference webReference;
|
Gui.WebReference webReference; |
||||||
// DiscoveryClientProtocol protocol;
|
DiscoveryClientProtocol protocol; |
||||||
// ReferenceProjectItem webServicesReferenceProjectItem;
|
ReferenceProjectItem webServicesReferenceProjectItem; |
||||||
// MSBuildBasedProject project;
|
MSBuildBasedProject project; |
||||||
//
|
|
||||||
// string name = "localhost";
|
string name = "localhost"; |
||||||
// string proxyNamespace = "WebReferenceNamespace";
|
string proxyNamespace = "WebReferenceNamespace"; |
||||||
// string updateFromUrl = "http://localhost/test.asmx";
|
string updateFromUrl = "http://localhost/test.asmx"; |
||||||
//
|
|
||||||
// [TestFixtureSetUp]
|
public override void FixtureSetUp() |
||||||
// public void SetUpFixture()
|
{ |
||||||
// {
|
base.FixtureSetUp(); |
||||||
// project = WebReferenceTestHelper.CreateTestProject("C#");
|
project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// project.FileName = "C:\\projects\\test\\foo.csproj";
|
project.FileName = FileName.Create("C:\\projects\\test\\foo.csproj"); |
||||||
//
|
|
||||||
// ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services");
|
ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services"); |
||||||
// ProjectService.AddProjectItem(project, referenceItem);
|
ProjectService.AddProjectItem(project, referenceItem); |
||||||
//
|
|
||||||
// protocol = new DiscoveryClientProtocol();
|
protocol = new DiscoveryClientProtocol(); |
||||||
// DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference();
|
DiscoveryDocumentReference discoveryRef = new DiscoveryDocumentReference(); |
||||||
// discoveryRef.Url = updateFromUrl;
|
discoveryRef.Url = updateFromUrl; |
||||||
// protocol.References.Add(discoveryRef);
|
protocol.References.Add(discoveryRef); |
||||||
//
|
|
||||||
// ContractReference contractRef = new ContractReference();
|
ContractReference contractRef = new ContractReference(); |
||||||
// contractRef.Url = "http://localhost/test.asmx?wsdl";
|
contractRef.Url = "http://localhost/test.asmx?wsdl"; |
||||||
// contractRef.ClientProtocol = new DiscoveryClientProtocol();
|
contractRef.ClientProtocol = new DiscoveryClientProtocol(); |
||||||
// ServiceDescription desc = new ServiceDescription();
|
ServiceDescription desc = new ServiceDescription(); |
||||||
// contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc);
|
contractRef.ClientProtocol.Documents.Add(contractRef.Url, desc); |
||||||
// protocol.References.Add(contractRef);
|
protocol.References.Add(contractRef); |
||||||
//
|
|
||||||
// WebReferenceTestHelper.InitializeProjectBindings();
|
WebReferenceTestHelper.InitializeProjectBindings(); |
||||||
//
|
|
||||||
// webReference = new SD.WebReference(project, updateFromUrl, name, proxyNamespace, protocol);
|
webReference = new Gui.WebReference(project, updateFromUrl, name, proxyNamespace, protocol); |
||||||
// webServicesReferenceProjectItem = (ReferenceProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.Reference);
|
webServicesReferenceProjectItem = (ReferenceProjectItem)WebReferenceTestHelper.GetProjectItem(webReference.Items, ItemType.Reference); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void WebServicesReferenceItemDoesNotExist()
|
public void WebServicesReferenceItemDoesNotExist() |
||||||
// {
|
{ |
||||||
// Assert.IsNull(webServicesReferenceProjectItem);
|
Assert.IsNull(webServicesReferenceProjectItem); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void WebServicesReferenceDoesNotExist1()
|
public void WebServicesReferenceDoesNotExist1() |
||||||
// {
|
{ |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Windows.Forms");
|
ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Windows.Forms"); |
||||||
// ProjectService.AddProjectItem(project, referenceItem);
|
ProjectService.AddProjectItem(project, referenceItem); |
||||||
//
|
|
||||||
// Assert.IsFalse(SD.WebReference.ProjectContainsWebServicesReference(project));
|
Assert.IsFalse(Gui.WebReference.ProjectContainsWebServicesReference(project)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void WebServicesReferenceExists1()
|
public void WebServicesReferenceExists1() |
||||||
// {
|
{ |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "system.web.services");
|
ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "system.web.services"); |
||||||
// ProjectService.AddProjectItem(project, referenceItem);
|
ProjectService.AddProjectItem(project, referenceItem); |
||||||
//
|
|
||||||
// Assert.IsTrue(SD.WebReference.ProjectContainsWebServicesReference(project));
|
Assert.IsTrue(Gui.WebReference.ProjectContainsWebServicesReference(project)); |
||||||
// }
|
} |
||||||
//
|
|
||||||
// [Test]
|
[Test] |
||||||
// public void WebServicesReferenceExists2()
|
public void WebServicesReferenceExists2() |
||||||
// {
|
{ |
||||||
// MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#");
|
MSBuildBasedProject project = WebReferenceTestHelper.CreateTestProject("C#"); |
||||||
// ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
|
ReferenceProjectItem referenceItem = new ReferenceProjectItem(project, "System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); |
||||||
// ProjectService.AddProjectItem(project, referenceItem);
|
ProjectService.AddProjectItem(project, referenceItem); |
||||||
//
|
|
||||||
// Assert.IsTrue(SD.WebReference.ProjectContainsWebServicesReference(project));
|
Assert.IsTrue(Gui.WebReference.ProjectContainsWebServicesReference(project)); |
||||||
// }
|
} |
||||||
// }
|
} |
||||||
//}
|
} |
||||||
|
|||||||
Loading…
Reference in new issue