Skip to content

Commit d2d8f8e

Browse files
committed
Changed the library to be a part of TestStack
1 parent 35a0905 commit d2d8f8e

29 files changed

Lines changed: 54 additions & 51 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ _ReSharper*
1212
*.log
1313
*/NUnit*/tools
1414
*/NhibernateProfiler*/tools
15-
packages
15+
packages
16+
*.DotSettings

FluentMVCTesting/robdmoore.snk

-596 Bytes
Binary file not shown.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
Fluent MVC Testing
1+
TestStack.FluentMVCTesting
22
====================================
33

4-
This library provides a fluent interface for creating terse and expressive tests against ASP.NET MVC controllers.
4+
This library provides a fluent interface for creating terse and expressive tests against ASP.NET MVC controllers. This library is part of [TestStack](http://teststack.github.com/).
55

66
This library is testing framework agnostic, so you can combine it with the testing library of your choice (e.g. NUnit, xUnit, etc.).
77

88
The library is compatible with the AAA testing methodology, although it combines the Act and Assert parts together (but you can also have other assertions after the Fluent assertion). See the code examples below for more information.
99

10-
The motivation behind this library is to provide a way to test MVC actions quickly, tersely and maintainably. Most examples I find on MVC controller testing are incredibly verbose, repetitive and time-consuming to write and maintain. Given how quickly you can write controller actions and how simple they are (assuming you are following best practices and keeping them lean) the time to test them generally isn't worth it given you can glance at most of your controller actions and know they are right or wrong instantly. This library aims to make the time to implement the tests inconsequential and then the value your tests are providing is worth it. The other problem that I've noticed with most examples of controller testing is that there are a lot of magic strings being used to test view and action names; this library also aims to (where possible) utilise the type system to resolve a lot of those magic strings, thus ensuring your tests are more maintainable and require less re-work when you perform major refactoring of your code.
10+
The motivation behind this library is to provide a way to test MVC actions quickly, tersely and maintainably. Most examples we find on MVC controller testing are incredibly verbose, repetitive and time-consuming to write and maintain. Given how quickly you can write controller actions and how simple they are (assuming you are following best practices and keeping them lean) the time to test them generally isn't worth it given you can glance at most of your controller actions and know they are right or wrong instantly. This library aims to make the time to implement the tests inconsequential and then the value your tests are providing is worth it. The other problem that we've noticed with most examples of controller testing is that there are a lot of magic strings being used to test view and action names; this library also aims to (where possible) utilise the type system to resolve a lot of those magic strings, thus ensuring your tests are more maintainable and require less re-work when you perform major refactoring of your code.
1111

12-
I came up with this library after using the [MVCContrib.TestHelper](http://mvccontrib.codeplex.com/wikipage?title=TestHelper) library for quite a while, but becoming frustrated with it; the library was initially created during an [experiment I conducted](http://robdmoore.id.au/blog/2011/03/14/terse-controller-testing-with-asp-net-mvc/) to try and create terse controller tests. I (and my team) have been using the library for over a year on a number of projects for the company that I work for.
12+
This library was inspired by the [MVCContrib.TestHelper](http://mvccontrib.codeplex.com/wikipage?title=TestHelper) library.
1313

1414
Installation
1515
------------
@@ -18,11 +18,11 @@ You can install this library using NuGet into your Test Library; it will automat
1818

1919
If you are using ASP.NET MVC 4 then:
2020

21-
Install-Package FluentMVCTesting
21+
Install-Package TestStack.FluentMVCTesting
2222

2323
If you are using ASP.NET MVC 3 then:
2424

25-
Install-Package FluentMVCTesting.Mvc3
25+
Install-Package TestStack.FluentMVCTesting.Mvc3
2626

2727
Known Issues
2828
------------
@@ -162,7 +162,7 @@ If you are redirecting to an action in another controller, then there are two sy
162162
// Or, if you want to check a partial is returned
163163
_controller.WithCallTo(c => c.Index()).ShouldRenderPartialView("ViewName");
164164

165-
Unfortunately, I couldn't think of a way to get rid of the magic strings here so where possible use the default ones above.
165+
Unfortunately, we couldn't think of a way to get rid of the magic strings here so where possible use the default ones above.
166166

167167
See below for model testing.
168168

@@ -264,4 +264,4 @@ You can chain the error property checks after any of these checks (you can only
264264
Any questions, comments or additions?
265265
--------------------------
266266

267-
Leave an issue on the GitHub project or a comment on my [blog](http://robdmoore.id.au/blog/2012/05/29/fluentmvctesting-fluent-terse-and-maintainable-asp-net-mvc-controller-testing/). Also, feel free to send through a pull request.
267+
Leave an issue on the [GitHub project](https://github.com/TestStack/TestStack.FluentMVCTesting/issues) or send a [pull request](https://github.com/TestStack/TestStack.FluentMVCTesting/pulls).

FluentMVCTesting.Mvc3/FluentMVCTesting.Mvc3.nuspec renamed to TestStack.FluentMVCTesting.Mvc3/FluentMVCTesting.Mvc3.nuspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package>
33
<metadata>
44
<id>
5-
FluentMVCTesting.Mvc3
5+
TestStack.FluentMVCTesting.Mvc3
66
</id>
77
<version>
88
1.0.0
@@ -11,7 +11,8 @@
1111
Robert Moore
1212
</authors>
1313
<description>
14-
Fluent library for testing ASP.NET MVC controllers. ASP.NET MVC 3 version; install FluentMVCTesting if you are using MVC4.
14+
Simple, terse, fluent unit testing of ASP.NET MVC Controllers.
15+
ASP.NET MVC 3 version; install FluentMVCTesting if you are using MVC4.
1516
</description>
1617
<projectUrl>
1718
http://github.com/robdmoore/FluentMVCTesting
File renamed without changes.

FluentMVCTesting.Mvc3/FluentMVCTesting.Mvc3.csproj renamed to TestStack.FluentMVCTesting.Mvc3/TestStack.FluentMVCTesting.Mvc3.csproj

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<ProjectGuid>{17E643B6-0448-4E6F-A8D8-D726154D73E1}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>FluentMVCTesting</RootNamespace>
12-
<AssemblyName>FluentMVCTesting.Mvc3</AssemblyName>
11+
<RootNamespace>TestStack.FluentMVCTesting</RootNamespace>
12+
<AssemblyName>TestStack.FluentMVCTesting.Mvc3</AssemblyName>
1313
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
@@ -36,7 +36,7 @@
3636
<SignAssembly>true</SignAssembly>
3737
</PropertyGroup>
3838
<PropertyGroup>
39-
<AssemblyOriginatorKeyFile>..\FluentMvcTesting\robdmoore.snk</AssemblyOriginatorKeyFile>
39+
<AssemblyOriginatorKeyFile>..\TestStack.FluentMvcTesting\TestStack.snk</AssemblyOriginatorKeyFile>
4040
</PropertyGroup>
4141
<ItemGroup>
4242
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -77,29 +77,29 @@
7777
<Reference Include="System.Xml" />
7878
</ItemGroup>
7979
<ItemGroup>
80-
<Compile Include="..\FluentMvcTesting\ControllerExtensions.cs">
80+
<Compile Include="..\TestStack.FluentMvcTesting\ControllerExtensions.cs">
8181
<Link>ControllerExtensions.cs</Link>
8282
</Compile>
83-
<Compile Include="..\FluentMvcTesting\ControllerResultTest.cs">
83+
<Compile Include="..\TestStack.FluentMvcTesting\ControllerResultTest.cs">
8484
<Link>ControllerResultTest.cs</Link>
8585
</Compile>
86-
<Compile Include="..\FluentMvcTesting\Exceptions.cs">
86+
<Compile Include="..\TestStack.FluentMvcTesting\Exceptions.cs">
8787
<Link>Exceptions.cs</Link>
8888
</Compile>
89-
<Compile Include="..\FluentMvcTesting\ModelErrorTest.cs">
89+
<Compile Include="..\TestStack.FluentMvcTesting\ModelErrorTest.cs">
9090
<Link>ModelErrorTest.cs</Link>
9191
</Compile>
92-
<Compile Include="..\FluentMvcTesting\ModelTest.cs">
92+
<Compile Include="..\TestStack.FluentMvcTesting\ModelTest.cs">
9393
<Link>ModelTest.cs</Link>
9494
</Compile>
95-
<Compile Include="..\FluentMvcTesting\ViewResultTest.cs">
95+
<Compile Include="..\TestStack.FluentMvcTesting\ViewResultTest.cs">
9696
<Link>ViewResultTest.cs</Link>
9797
</Compile>
9898
<Compile Include="Properties\AssemblyInfo.cs" />
9999
</ItemGroup>
100100
<ItemGroup>
101-
<None Include="..\FluentMvcTesting\robdmoore.snk">
102-
<Link>robdmoore.snk</Link>
101+
<None Include="..\TestStack.FluentMvcTesting\TestStack.snk">
102+
<Link>TestStack.snk</Link>
103103
</None>
104104
<None Include="FluentMVCTesting.Mvc3.nuspec" />
105105
<None Include="packages.config" />
File renamed without changes.

FluentMVCTesting.Tests/ControllerExtensionsTests.cs renamed to TestStack.FluentMVCTesting.Tests/ControllerExtensionsTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using FluentMVCTesting.Tests.TestControllers;
2-
using NUnit.Framework;
1+
using NUnit.Framework;
2+
using TestStack.FluentMVCTesting.Tests.TestControllers;
33

4-
namespace FluentMVCTesting.Tests
4+
namespace TestStack.FluentMVCTesting.Tests
55
{
66
[TestFixture]
77
class ControllerExtensionsShould

FluentMVCTesting.Tests/ControllerResultTestTests.cs renamed to TestStack.FluentMVCTesting.Tests/ControllerResultTestTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
using System.Linq.Expressions;
44
using System.Net;
55
using System.Web.Mvc;
6-
using FluentMVCTesting.Tests.TestControllers;
76
using NUnit.Framework;
7+
using TestStack.FluentMVCTesting.Tests.TestControllers;
88

9-
namespace FluentMVCTesting.Tests
9+
namespace TestStack.FluentMVCTesting.Tests
1010
{
1111
[TestFixture]
1212
class ControllerResultTestShould

FluentMVCTesting.Tests/ModelErrorTestTests.cs renamed to TestStack.FluentMVCTesting.Tests/ModelErrorTestTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using NSubstitute;
66
using NUnit.Framework;
77

8-
namespace FluentMVCTesting.Tests
8+
namespace TestStack.FluentMVCTesting.Tests
99
{
1010
class ModelErrorTestMetadata : Tuple<string, string, string, ModelErrorTestCall>
1111
{

0 commit comments

Comments
 (0)