Browse by Tags

All Tags » Testing Guidelines (RSS)

Unit Testing Denial Pattern #1: Pretending the test is no longer valid

Today was both a good day for e and a bad day for me. Good day because I managed to get a full suite of tests that were somehow failing to work again after a refactoring that got out of hand. Bad - because out of all the tests, one of them failed. Here...

Pros and Cons and of using an Auto Mocking container in your tests

In regards to my post about injecting mocks and stubs using a container in your tests, Dave asks in the comments: Why would you want to do this in the first place? Here are the things I can think about right now (pros and cons). I'd love to hear your...

Testing XML serialization attributes

Not sure how I feel about this particular brand of testing syntax . still, it's good that someone thought this problem through - testing xml serialization attributes. [via the morning brew ]

Injecting Typemock Stubs and Mocks using the StructureMap container in a unit test

Someone asked for examples of how you'd inject stubs and mocks when you'd like your object under test to use a container such as StructureMap . here are a couple of simple tests to show this using Typemock Isolator . the first uses the string based mocks...

Creating a AutoMockingContainer with Microsoft Unity - Pretty darn simple.

updated : made container more readable Just created a little Auto Mocking Container built on Microsoft Unity. It was very very simple. here's a test that uses it. We tell the container to Returna stub for T because we will want whoever calls resolve<T>...

Testing ASP.NET MVC Controllers with Typemock Isolator

Scott Hanselman posted his notes and slides (and movies!) from his talk on the ASP.NET MVC framework, where he also mentioned and shows how he's write unit tests for the MVC framework in ASP.NET. Scott has examples both in Moq and Rhino.Mocks on how to...
Posted by RoyOsherove | with no comments

Basic Guidelines for using RowTest and data driven tests

I took a look at the code that was used to create the NUnit RowTest Extension (which is pretty neat) and found this in one of the samples: The highlighted areas in the code show something which I feel is problematic and is the manifestation of a unit...

Data Layer Testing: Test Inheritance Patterns

I'm preparing for my tutorial on Database and Data Layer unit testing that I will be giving at the Agile Practices Conference  next week. It's always nice to have a full 3 hours to get pretty deep into something. 75 minutes just isn't enough to grasp...

Mocking LINQ Queries, Extension methods and Anonymous Types

One of the things I wanted to show at my Interactive session on unit testing tips and tricks at TechEd this year was how you can "Stub" out results from LINQ Queries, or mock\stub Extension methods in .NET 3.5 ( what's the difference between...

The various meanings of TDD

Update : more on this here and here , and Jim has a whole article on this here . Now that I'm having some real time to write something I thought I'd try to write down my thoughts starting all the way back from JAOO and what I learned from it. Specifically...
More Posts Next page »