Testing ASP.NET MVC application with Session state

I ran into trouble when I tried to use Session-state in an ASP.NET MVC application.

The hit came when I tried to write a unit test for the Action-method that stored stuff in the Session-object.

For a short while I found myself pondering that, but then I ran home to mummy – MVC Contrib. My God – they have much useful in there.

The thing that save me this time was the TestHelper, that solved exactly my problem.

Installed in three minutes and up and running again in five. Great!

Read More

Agile testing – some thoughts after an excellent Elevate-evening

Yesterday was another Elevate-evening and again I was impressed by the diversity and knowledge of the consultants of Avega.

The theme for last night was; Agile Testing. This is an area that has confused and frustrated (is that a word?) me for some time. I haven’t got it to work in any of the agile teams I have been leading. Here are sample of my failures (as in failure is good – an opportunities to learn :));

  • No testers and no testing in the team. This was a disaster. We did agile development but when we were done a 3 month testing phase took place. Sounds a lot like waterfall to me. And we didn’t harvest any of the goodness that agile can bring.
  • Testers in the team – but not doing agile testing. So we decided to move testers into the team. But they...
Read More

Marcus trying JQuery

I still cannot believe that JavaScript has become so big… This is a language that many of us laughed at just a couple years back – but now we all stand corrected.

OK, swallowing my pride I am still happy that a number of JavaScript libraries has emerged so that I don’t have to hack it all by my own. Again…

One of the most talked libraries about these days is JQuery, which I actually thought was some kind of LINQ-dialect. But even if don’t have to hack it myself, I still need to learn it. And also CSS apparently since JQuery works a lot with CSS-classes and stuff.

Luckily there are some great tutorials and screencast (which I happen to like more) out there. Here is my recommended starter. It’s for designers so beware of some funky words and coolness from the presenter…

...
Read More

ÖreDev day 5 – afternoon

Cucumber

This will be interesting, I love the idea of Cucumber. Also the presenter, Aslak Hellesöy, has a blender on the desk… Eeeh.

He started out with a small introduction of BDD and actually TDD also. He took standpoint in the Dan North ideas on BDD, that is a outside-in approach (as apposed to the TDD outside-in), but putting the business value in the front of the sentence.

This guy is apparently the inventor of Cucumber, which has gain many followers and support in the community. It looks very well documented.

OK – the blender part wasn’t a success but it looked funny ;).

The rest of the talk was a demonstration of the basics in Cucumber and it was all really interesting. I will most certainly check this out. Although he didn’t go anywhere near .NET and C#,...

Read More

ÖreDev day 5 – keynote and morning'

Information overload and managing flow

The last day kicks off with a keynote given by Scott Hanselmann, who is one of my “heroes” if you like. I always wanted to see him live, he is usually informative and really funny. Here is some off his tips on the subject:

Effectiveness – doing the right things

Efficiency – doing the things right (jumping off a cliff in a efficient way :))

Triage – sort information. Don’t leave things in your inbox

Do it – drop it – delegate it – defer it = pick one.

Sort your data streams (twitter, email, colleague) into Signals and Noise

Email that you’re cc:ed on are not as important To:

Mailing list

Don’t check emails in the morning - “If you are the fastest responder to a problem, you will get all the problems.”

Check email three times a day – for...

Read More

ÖreDev day 4 – afternoon

I’m still feeling a bit exhausted from the last Dan North talk. Now we will have some more down-to-earth code stuff.

Putting the M of ASP.NET MVC with Scott Allen

Scott started off by defining the purpose of the model is, who does it serve?

  • Business objects are great if you build a wrapper on SQL Management Studio ;)
  • The model can be found serving two master – both the view and the business logic.
  • The answer to the above is too create a view model. But that can give you a lot of classes. I (and Scott) think that will be worth it – because every class now have a well defined responsibility.
  • Cool – you can define an interface that decides what properties to bind when using TryUpdateModel<T>
  • Don’t use IModelBinder to bind your own models because you’ll have to...
Read More

ÖreDev day 4 – Why your agile adoption fails with Dan North

This became so much and was so good that I publish it as a separate post.

After pretty disappointing morning I’m hoping that Dan North will bring things back to great – as most of the day was yesterday.

Dan promised yesterday that he will bash on Scrum a lot in this talk… And at the same time as this there is a talk on Entity Framework 2.0. With Ayende and Scott Bellware in the audience…

OK – our hall is filling up. Dan is smiling. Could be fun. Here are some quotes:

  • A manager in a crappy system with a certificate is still a manager in a crappy system
  • Certified$crumMa$ter :)
  • Check out the Satir change model to understand peoples reluctance to change
  • Think of the different stages of the Dreyfus model
  • “75% of uncoached Scrum projects will...
Read More

ÖreDev day 4 – morning

We’re of to a brand new day. Feel well rested although last night was quite late…

Keynote: What drives design?

This can be very interesting, if focus on the last two D in any [x]DD-technique (TDD, BDD etc). I’ll make a summary in the end.

This was a interesting historical overview to start with. Pretty cool that our industry is so young that the people who “started it all” are still not that old. Cool to hear about their troubles and stumbling on their way to greatness.

Rebecca Wirfs-Brock talked a lot about the RDD (responsibility driven design) and the patterns behind it. Then said compared it to other DD-techniques, such TDD, BDD, FDD and DDD and so forth.

Making the sausage

Now this should be interesting if by no other reason because of the speakers;...

Read More

ÖreDev day 3 – afternoon

The fallacy of efficiency

Dan North – given a talk on not believing in efficiency (the theme of the conference) ;).

What he is aiming at is the difference in efficiency (the effort we burnt so far) and effectiveness (the outcome is what’s important, not how much we burnt so far).

OK – this is great! He is dropping gold ever ten seconds. I just hope to get hold of the slides, and try to post them here. I cannot possible summarize it here… It’s boarder-lining on politics but I like it.

Dan North – check him out. He’s great and quite funny also.

OK – best so far! By far!

Explorations of <a href=”https://www.hibernate.org/343.html”

target=”_blank”>NHibernate</a>

This will be another talk by Stephen Bohlen, the speedtalker… So I don’t expect to be able to write to much during this.

We’re learning about add-ons (etc.)...

Read More