SpecFlow presentation at Sweden Progressive .NET

I got an invitation to Sweden Progressive .NET (the group formerly known as Alt.Net Sweden) to do a presentation on SpecFlow. I known many of the people in this group, a lot of them work for Avega, and have the highest respect for their knowledge. So to get an invite from them to talk about a BDD tool was really… cool. And a bit nervous. But it also made me up my game and I put quite a lot of time into creating a demonstration project that shows the different features of SpecFlow and how to use the ins and out of them. Of course, I created features for them so that you easily can read and understand the features without even have to look at code. This was inspired by how TechTalk themselves spec’s out new features of SpecFlow and proved to work very well. I plan to update...
Read More

Error “The provider did not return a ProviderManifestToken string” with SQL Compact Edition

I was totally terrified when this happened to my yesterday. I had prepared a little website to use on a SpecFlow demonstration. I had run it several times and it worked fine. But all of a sudden – when I was doing one of those “just checking” it failed on me with this (“The provider did not return a ProviderManifestToken string”) error. The site was using Entity Framework Code first with SQL CE as described here Goggling for it didn’t help me to much but I suddenly realized that something was missing. I had used MvcScaffolding to create the database, but I hadn’t added any entries into the .config. Neither had MvcScaffolding but it was totally a slip from me. So I simply added this: <connectionStrings> <add name="[Name from you dbcontext class]" connectionString="DataSource=|DataDirectory|AnyName.sdf" providerName="System.Data.SqlServerCe.4.0"/> </connectionStrings> A few words here: When adding this connection string the database got created. You might...
Read More

In SpecFlow the test runner is just glue

I answered a question on Twitter today from a guy who had problems running SpecFlow scenarios with MSTest. That shouldn’t be I thought to myself – in SpecFlow the test runner is only used for the auto-generated stuff (#2 in this pictures) and shouldn’t affect the code you write. Lets try it. The default test runner is NUnit so first I simply create a new Specs-project and created the following scenario: I then Nuget’d SpecFlow, Should and NUnit with these commands: Install-Package SpecFlow Install-Package NUnit Install-Package ShouldFluent And sure enough – when I compile some NUnit code is auto generated for me: Just for good manners I implemented the steps and ran the specification. It worked with these (naïve) steps in place: If I now change the app.config (added by NuGet install of SpecFlow) and configures it to use MsTest, like this: And then add MsTest with a reference. Finally...
Read More

Kanbanboards V–creating new boards

OK – after the last post of refactoring I now feels great to turn my focus on some new functionality; I want to let the users create new Kanban boards. This involves some new views and controllers stuff, uploading pictures and also changes in the domain model. I got some valuable feedback from my colleague Joakim Sunden on the real purpose of the Kanban board application / site. I actually never wrote it down. So I’ve updated the first post in the series with the following: www.kanban-boards.com will be a site where users can upload their Kanban boards for other people to see, vote on and get inspired by. In this way we can share and learn from each other I think and hope. The creation of this site is documented as my learning process. On with the show! New functionality – new scenario As I always I start off...
Read More

Customize your SpecFlow templates and more

I got this tip from a non-developer. An intern actually. He’s brilliant though and figured this out by himself, about 3 months after I introduced him to SpecFlow. Thank you Dejen – you’re great! The fact that this is not documented anywhere just adds to the coolness, but also make the solution a bit hackish. Sorry for that. As it seems – SpecFlow is storing templates for the feature-files in this folder: C:\Program Files (x86)\TechTalk\ SpecFlow\ItemTemplates\ I’m using a 64-bit system so your path may not contain the (x86)-part. Here you’ll find a number of zip-archives that contains the templates. You can modify the EventDefinition- (Hooks) and the StepDefinition-templates and (maybe most common) the Feature-template. All the structure is the same so you can follow it in the same manner as below. How to modify the Feature template Make a Copy of the current template (SpecFlowFeature.zip) just to be sure...
Read More

Kanbanboards IV–shaping stuff up

I have now coded away for a while and it’s time to reflect a refactor a bit. I don’t like code lying around that I might not need. YAGNI you know… So I thought I’d give it an hour to clean stuff up. And maybe put some better looks on the site. Hopefully I’ll end up in a better place. Here are the things I have planned: Remove all the Views and Controller methods that I’m not using Bring in a theme for the site Shape up the lists on the first page Create a page object to write my acceptance tests against Introduce a read service for the site – the start of my CQRS initiative Man – that looked long! But most of them are small. Just imaging how much better the code will be afterwards. Here we go. Remove unused stuff OK – I love the MvcScaffolding...
Read More

CQRS–another love story

People who know me also know that I easily get all ga-ga, fall in love in or simply get very excited over thing that I like. Actually the other day I thought for myself that I right now talk a lot about BDD, Specflow and Kanban – simply because I think that these things are just great. A quote that I often use by Dan North; “It’s no silver bullet, but this darn close” When I thought about that I also came to think that I don’t want to talk about or focus on things that I don’t feel like that for. There are simply to many new concepts, frameworks and technologies out there – I cannot take them all in and of course not be ga-ga over all of them. The second that thought left my mind I started to watch a recording of Greg Young from ÖreDev last...
Read More

Using Unity as dependency resolver in ASP.NET MVC 3

There have been a lot of improvements and additions to dependency resolving in ASP.NET MVC 3. Even in areas that you first didn’t think about (dependency injection in views) at first. OK – after my last post, in which I’m using Ninject (with the cool website) I got the questions if it can be done with Unity. Of course it does. This post shows how. I’m using Ninject because of the super-slick integration with ASP.NET MVC 3 via NuGet. It gives my a “correct” and easy to start with solution. The main part in this found in this App_Start static file, that is run before any other code with the Web Activator mechanism: And converting that to Unity would be something like this: Yup – actually that’s all it’s too it. For a while there I was “worried” that I would have to implement a ServiceLocator (line 22 above). That’s...
Read More

How to apply a pull request on GitHub with TortoiseGit

I am loving GitHub! Especially the social collaboration that occur around the projects and code. If you never committed code to a OSS project try it – it’s a exhilarating feeling. And just imaging the other side of the coin – to get suggestions and improvements from other people sent to you! That’s the good news – the bad news (for me at least) is the Git is something else. It’s great but it takes some getting used to. I’m not there yet. For example the preferred way seems to be command line, and I haven’t got used to that yet. There are some GUIs available that help people like me to overcome the abyss, the most well known is TortoiseGit. That was the tool finally got me to understand, use and love GitHub. But when I got a pull request sent to me I hit a brick wall. At...
Read More

Kanbanboards III–putting on the web

After my latest post-of-admitting-failures I got some really nice feedback from a lot of people. Apparently there are others out there who think that a failure is great learning opportunity. OK – I will most certainly continue down that path. I actually write these post as I code along. It’s forward only mode in other words… Almost. Comments One of the nicest things that happened as a result from the last post was that Darren Cauthon gave me some insightful comments and patches to go with them. This “social coding” that is going on, on www.github.com (a.k.a. programmers Facebook) is really, really cool. Darren has done a lot of stuff in and around the SpecFlow project, for example the SpecFlow Assist (table helpers) that is really great. So I value his opinions a lot. He gave me 4 points to think about and I thought I comment them here as...
Read More