Configuration branch
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -15,23 +14,9 @@
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -41,7 +26,6 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -50,14 +34,13 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="HtmlAgilityPack, Version=1.3.0.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Endpoint\References\HtmlAgilityPack.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Endpoint\References\Oracle.DataAccess.dll</HintPath>
|
||||
@@ -71,12 +54,9 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="SoapEndpointTest.cs" />
|
||||
<Compile Include="HtmlEndpointTest.cs" />
|
||||
<Compile Include="HttpEndpointTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WindowsServiceEndpointTest.cs" />
|
||||
<Compile Include="WmiEndpointTest.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Endpoint\Endpoint.csproj">
|
||||
@@ -84,28 +64,6 @@
|
||||
<Name>Endpoint</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
using System;
|
||||
using Endpoint;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace EndpointTest
|
||||
{
|
||||
/// <summary>
|
||||
///This is a test class for HtmlEndpointTest and is intended
|
||||
///to contain all HtmlEndpointTest Unit Tests
|
||||
///</summary>
|
||||
[TestClass]
|
||||
/// <summary>
|
||||
///This is a test class for HtmlEndpointTest and is intended
|
||||
///to contain all HtmlEndpointTest Unit Tests
|
||||
///</summary>
|
||||
[TestClass()]
|
||||
public class HtmlEndpointTest
|
||||
{
|
||||
// Random website for functional testing
|
||||
private readonly Uri _goodUri = new Uri("http://www.seekwellness.com/sca/");
|
||||
|
||||
/// <summary>
|
||||
@@ -20,16 +18,16 @@ namespace EndpointTest
|
||||
[TestMethod]
|
||||
public void HtmlEndpointConfigurationTest()
|
||||
{
|
||||
var target = new HtmlEndpoint
|
||||
{
|
||||
UriString = _goodUri.OriginalString,
|
||||
XpathQuery = "//td[contains(text(), 'Use this form')]/text()",
|
||||
ExpectedXpathResult = "Use this form to order your",
|
||||
RequestContent = "redeem_coupon=true&f_coupon_code=stuff"
|
||||
};
|
||||
HtmlEndpointConfiguration config =
|
||||
new HtmlEndpointConfiguration {
|
||||
UriString = _goodUri.OriginalString,
|
||||
XpathQuery = "//td[contains(text(), 'Use this form')]/text()",
|
||||
ExpectedXpathResult = "Use this form to order your",
|
||||
RequestContent = "redeem_coupon=true&f_coupon_code=stuff"
|
||||
};
|
||||
HtmlEndpoint target = new HtmlEndpoint(config); // TODO: Initialize to an appropriate value
|
||||
|
||||
var status = target.GetStatus();
|
||||
Assert.AreEqual(Status.Up, status, target.StatusDescription);
|
||||
Status status = target.GetStatus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -38,15 +36,17 @@ namespace EndpointTest
|
||||
[TestMethod]
|
||||
public void HtmlEndpointFormTest()
|
||||
{
|
||||
var target = new HtmlEndpoint
|
||||
{
|
||||
UriString = _goodUri.OriginalString,
|
||||
XpathQuery = "//p[@class='errorMsg']/text()",
|
||||
ExpectedXpathResult = "- Please enter a valid coupon code.",
|
||||
RequestContent = "redeem_coupon=true&f_coupon_code=stuff"
|
||||
};
|
||||
HtmlEndpointConfiguration config =
|
||||
new HtmlEndpointConfiguration
|
||||
{
|
||||
UriString = _goodUri.OriginalString,
|
||||
XpathQuery = "//p[@class='errorMsg']/text()",
|
||||
ExpectedXpathResult = "- Please enter a valid coupon code.",
|
||||
RequestContent = "redeem_coupon=true&f_coupon_code=stuff"
|
||||
};
|
||||
HtmlEndpoint target = new HtmlEndpoint(config); // TODO: Initialize to an appropriate value
|
||||
|
||||
var status = target.GetStatus();
|
||||
Status status = target.GetStatus();
|
||||
Assert.AreEqual(Status.Up, status, target.StatusDescription);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +1,32 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using Endpoint;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
|
||||
namespace EndpointTest
|
||||
{
|
||||
/// <summary>
|
||||
///This is a test class for HttpEndpointTest and is intended
|
||||
///to contain all HttpEndpointTest Unit Tests
|
||||
///</summary>
|
||||
[TestClass]
|
||||
/// <summary>
|
||||
///This is a test class for HttpEndpointTest and is intended
|
||||
///to contain all HttpEndpointTest Unit Tests
|
||||
///</summary>
|
||||
[TestClass()]
|
||||
public class HttpEndpointTest
|
||||
{
|
||||
private readonly Uri _goodUri = new Uri("http://www.google.com");
|
||||
private readonly Uri _goodUri = new Uri("http://www.google.com");
|
||||
private readonly Uri _missingUri = new Uri("http://www.google.com/gasdfasdh598yqwejbiasalsdjfhaogle");
|
||||
private readonly Uri _unreachableDomainUri = new Uri("http://gasdfasdh598yqwejbiasalsdjfhaogle");
|
||||
private readonly Uri _downUri = new Uri("http://192.168.0.153");
|
||||
private readonly Uri _httpsUri = new Uri("https://sourceforge.net/");
|
||||
|
||||
/// <summary>
|
||||
///A test for HttpEndpoint Constructor
|
||||
///A test for Url
|
||||
///</summary>
|
||||
[TestMethod]
|
||||
public void HttpEndpointConstructorTest()
|
||||
public void UrlTest()
|
||||
{
|
||||
HttpEndpoint endpoint = new HttpEndpoint {Uri = _goodUri};
|
||||
Assert.AreEqual(_goodUri, endpoint.Uri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///A test for UrlString
|
||||
///</summary>
|
||||
[TestMethod]
|
||||
public void UrlStringTest()
|
||||
{
|
||||
HttpEndpoint endpoint = new HttpEndpoint {UriString = "http://uri/"};
|
||||
Assert.AreEqual("http://uri/", endpoint.Uri.AbsoluteUri);
|
||||
HttpEndpoint endpoint = new HttpEndpoint(new HttpEndpointConfiguration("", _goodUri));
|
||||
Assert.AreEqual(_goodUri, endpoint.HttpEndpointConfiguration.Uri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -43,7 +35,7 @@ namespace EndpointTest
|
||||
[TestMethod]
|
||||
public void GetStatusGoodTest()
|
||||
{
|
||||
HttpEndpoint endpoint = new HttpEndpoint {Uri = _goodUri};
|
||||
HttpEndpoint endpoint = new HttpEndpoint(new HttpEndpointConfiguration("", _goodUri));
|
||||
Assert.AreEqual(Status.Up, endpoint.GetStatus());
|
||||
}
|
||||
|
||||
@@ -53,7 +45,7 @@ namespace EndpointTest
|
||||
[TestMethod]
|
||||
public void GetStatusMissingTest()
|
||||
{
|
||||
HttpEndpoint endpoint = new HttpEndpoint {Uri = _missingUri};
|
||||
HttpEndpoint endpoint = new HttpEndpoint(new HttpEndpointConfiguration("", _missingUri));
|
||||
Assert.AreEqual(Status.Unreachable, endpoint.GetStatus());
|
||||
}
|
||||
|
||||
@@ -63,7 +55,7 @@ namespace EndpointTest
|
||||
[TestMethod]
|
||||
public void GetStatusUnreachableTest()
|
||||
{
|
||||
HttpEndpoint endpoint = new HttpEndpoint {Uri = _unreachableDomainUri};
|
||||
HttpEndpoint endpoint = new HttpEndpoint(new HttpEndpointConfiguration("", _unreachableDomainUri));
|
||||
Assert.AreEqual(Status.Unreachable, endpoint.GetStatus());
|
||||
}
|
||||
|
||||
@@ -73,7 +65,7 @@ namespace EndpointTest
|
||||
[TestMethod]
|
||||
public void GetStatusDownTest()
|
||||
{
|
||||
HttpEndpoint endpoint = new HttpEndpoint {Uri = _downUri};
|
||||
HttpEndpoint endpoint = new HttpEndpoint(new HttpEndpointConfiguration("", _downUri));
|
||||
Assert.AreEqual(Status.Unreachable, endpoint.GetStatus());
|
||||
}
|
||||
|
||||
@@ -83,8 +75,18 @@ namespace EndpointTest
|
||||
[TestMethod]
|
||||
public void GetHttpsTest()
|
||||
{
|
||||
HttpEndpoint endpoint = new HttpEndpoint {Uri = _httpsUri};
|
||||
HttpEndpoint endpoint = new HttpEndpoint(new HttpEndpointConfiguration("", _httpsUri));
|
||||
Assert.AreEqual(Status.Up, endpoint.GetStatus());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///A test for HttpEndpoint Constructor
|
||||
///</summary>
|
||||
[TestMethod]
|
||||
public void HttpEndpointConstructorTest()
|
||||
{
|
||||
HttpEndpoint endpoint = new HttpEndpoint(new HttpEndpointConfiguration("", _goodUri));
|
||||
Assert.AreEqual(_goodUri, endpoint.HttpEndpointConfiguration.Uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user