mspec

Using MSpec runner in Visual Studio 2010 and .NET 4

Hi Everyone, I'm a big fan of MSpec so naturally I wanted to use is right away with VS2010 as well. I have the MSpec runner defined as an external tool in Visual Studio to be able to have it always visible as a toolbar item. Anyway, whenever I try to use the MSpec runner (mspec.exe) with a .NET 4.0 solution I get the following error: ...

DRY-ing very similar specs for ASP.NET MVC controller action with MSpec (BDD guidelines)

Hi all, I have two very similar specs for two very similar controller actions: VoteUp(int id) and VoteDown(int id). These methods allow a user to vote a post up or down; kinda like the vote up/down functionality for StackOverflow questions. The specs are: VoteDown: [Subject(typeof(SomeController))] public class When_user_clicks_the_vo...

Error when running MSpec - how do I troubleshoot?

I am following this guide to installing and using MSpec, but at the step where he runs MSpec for the first time, I get the following error: Could not load file or assembly 'file:///[...]\Nehemiah\Nehemiah.Specs\bin\Debug\Nehemiah.Specs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loade...

Testing ActionFilterAttributes with MSpec

I'm currently trying to grasp MSpec, mainly to learn new ways of (T/B)DD to be able to make an educated decision on which technology to use. Previously, I've mostly (read: only) used the built-in MSTest framework with Moq, so BDD is quite new for me. I'm writing an ASP.NET MVC app, and I want to implement PRG. Last time I did this, I us...

Can I "inherit" a delegate? Looking for ways to combine Moq and MSpec without conflicts around It...

I have started to use MSpec for BDD, and since long ago I use Moq as my mocking framework. However, they both define It, which means I can't have using Moq and using Machine.Specifications in the same code file without having to specify the namespace explicitly each time I use It. Anyone who's used MSpec knows this isn't really an option...

Why does this test fail?

I'm trying to test/spec the following action method public virtual ActionResult ChangePassword(ChangePasswordModel model) { if (ModelState.IsValid) { if (MembershipService.ChangePassword(User.Identity.Name, model.OldPassword, model.NewPassword)) { return RedirectToAction(MVC.Account.Actions.ChangePass...

BDD with Machine.Specifications in Visual Studio 2010

I'm beginning to get the grips of BDD and MSpec, but I'm still really bugged by the fact that I'm unable to debug my tests/specs, and that I have to leave the IDE to go to a html report file to see the results. Currently, I have a post build event configured to run mspec.exe $(TargetFileName) --html “$(ProjectDir)Report.html”, but there...

Resharper 5.0 and Machine.Specification (Individual Tests are grayed out)

I am having an issue with running Machine Specification tests using Resharper 5.0. The individual tests appear as greyed out in the Reshaper Test Runner and I am also not able to debug them using the Resharper. Although none of the tests is running but I still see the green bar as if all the tests were successfully passed. Any ideas as t...

MSpec & Resharper test runner problem

I'm using MSpec and Visual Studio 2010 with Resharper 5.1. I've installed the MSpec test runner plugin into resharper but it's not working properly. Here's my test: public class when_I_click_create_investment_manager : with_main_window { Establish I_am_viewing_the_main_page = () => mainWindowViewModel = new MainWindowVie...

How to develop input object with TDD / BDD?

I have a method called ProcessPayment() that I'm developing via BDD and mspec. I need help with a new challenge. My user story says: Given a payment processing context, When payment is processed with valid payment information, Then it should return a successful gateway response code. To set up the context, I am stubbing my gateway ser...

Using Behaves_like<TBehavior> on a Base Class

I would like to specify a Behaves_like on a base specification to ensure that a particular method is marked as virtual. Something like this: public abstract class command_handler_context<TCommandHandler, TCommand> : abstract_context<TCommandHandler> where TCommandHandler : ICommandHandler<TCommand> where TCommand : ICommand...

MSpec and ReSharper Problem

I've got the latest mspec from the codebetter teamcity site and installed the Resharper5.1 runner as suggested. The runner and the annotations show up fine in the resharper option dialogs. Now even with the annotations library ticked I still get "field xxx is never used" warnings everywhere and when I ask resharper to run all tests in ...

Cannot run mspec.exe with Syste.Data.SQLite.dll x86, but it works in R# MSpec runner

Hi, I use mspec for my tests and have a NHiernate Setup using SQLite x86 for my database in the tests. The problem is that when i run my test using the mspec r# runner everything works fine but running it from the console thwors an error that it cannot find the sqlite dll. My config of the specification projects: .net 4 x86 (using th...

MSpec in Visual Studio 2010 still does not work properly

Someone asked a similar question before, getting the following error when I run MSpec in Visual Studio 2010: Could not load file or assembly 'Machine.Specifications.dll' or one of its dependencies. The system cannot find the file specified. The solution in the other post was to download the .net4 specific version of MSpec. But, that'...

Comparing two lists with MSpec

Which method should I use to assert that two lists contains the same objects with MSpec? ...