Skip to content

Commit

Permalink
Added First Tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
shanielh committed Dec 31, 2013
1 parent af736a9 commit 48a6bc7
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 6 deletions.
4 changes: 2 additions & 2 deletions AssemblyCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("uhttpsharp")]
[assembly: AssemblyCopyright("Copyright © 2011")]
[assembly: AssemblyProduct("µHttpSharp")]
[assembly: AssemblyCopyright("Copyright © 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
42 changes: 42 additions & 0 deletions uhttpsharp.Tests/HttpMethodProviderTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;

namespace uhttpsharp.Tests
{
[TestFixture]
public class HttpMethodProviderTests
{

private static IHttpMethodProvider GetTarget()
{
return new HttpMethodProvider();
}


private IEnumerable<string> Methods
{
get
{
return Enum.GetNames(typeof(HttpMethods));
}
}

[TestCaseSource("Methods")]
public void Should_Get_Right_Method(string methodName)
{
// Arrange
var target = GetTarget();

// Act
var actual = target.Provide(methodName);

// Assert
Assert.IsTrue(StringComparer.InvariantCultureIgnoreCase.Equals(actual.ToString(), methodName));
}

}
}
4 changes: 2 additions & 2 deletions uhttpsharp.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("uhttpsharp.Tests")]
[assembly: AssemblyTitle("µHttpSharp Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("uhttpsharp.Tests")]
[assembly: AssemblyProduct("µHttpSharp Tests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
4 changes: 4 additions & 0 deletions uhttpsharp.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.3" targetFramework="net45" />
</packages>
13 changes: 13 additions & 0 deletions uhttpsharp.Tests/uhttpsharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -39,8 +42,18 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HttpMethodProviderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\uhttpsharp\uhttpsharp.csproj">
<Project>{3D681959-4DA3-4A71-A68B-704D6411D5EA}</Project>
<Name>uhttpsharp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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.
Expand Down
2 changes: 1 addition & 1 deletion uhttpsharp/HttpMethodProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class HttpMethodProvider : IHttpMethodProvider
{
public static readonly IHttpMethodProvider Default = new HttpMethodProviderCache(new HttpMethodProvider());

private HttpMethodProvider()
internal HttpMethodProvider()
{

}
Expand Down
5 changes: 4 additions & 1 deletion uhttpsharp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand All @@ -27,4 +28,6 @@

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("2a229a48-3435-4e8d-bfda-9e2535940a81")]
[assembly: Guid("2a229a48-3435-4e8d-bfda-9e2535940a81")]

[assembly:InternalsVisibleTo("uhttpsharp.Tests")]

0 comments on commit 48a6bc7

Please sign in to comment.