// 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 { /// /// Tests that the generated filename ends with .vb if the project is /// a vb project. /// [TestFixture] public class VBWebReferenceTest : 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("VB"); 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); } } }