Category Archives: Testing

Structuring an MVC app for easy testing

Introduction In this article I want to give you some handles to structure your MVC applications in such a way that they become easier to test. The article isn’t really about MVC, but if you want more information on MVC, I … Continue reading

Posted in .Net, Codeproject, Development, MVC, Testing | Leave a comment

Unit Testing your Repositories–the code

In the previous post I started to write about how to set up your unit tests in the repository code. The title was (maybe a bit misleading) “Unit testing your Repositories”. So I had to promise to write an article … Continue reading

Posted in .Net, Codeproject, Debugging, Development, Entity Framework, Testing | Tagged | 1 Comment

Unit testing your Repositories

The problem We have created our data layer, and of course we want to test it. It is very hard to use a (physical) database to test your code. There are some problems with this (commonly used) approach: Unit tests … Continue reading

Posted in .Net, Architecture, Codeproject, Development, Entity Framework, Testing | Tagged | 1 Comment

Mocking functionality using MOQ

What is wrong with this code? class Program { static void Main(string[] args) { DateTime dob = new DateTime(1967, 7, 9); int days = CalcDays(dob); Console.WriteLine($”Days: {days}”); }     private static int CalcDays(DateTime dob) { return (DateTime.Today – dob).Days; } … Continue reading

Posted in .Net, Codeproject, Development, OOAD, Testing | Tagged | 1 Comment

Handling a “Microservices” Project

I’m currently working on a big application that has been built up using microservices. The application is composed of small(ish) apps that compose the application. The idea is that these small apps work together to create the final application. This … Continue reading

Posted in Analysis, Architecture, Codeproject, Development, Methodology, Testing | Tagged | Leave a comment

Grasshopper Unit testing

“I have created my code, split out some functionality and written the tests. But the mocks have become a real mess, and much more work than I had thought it would be. Can you help me, Sensei?” “Of course. Show … Continue reading

Posted in .Net, Codeproject, Development, Methodology, Testing | Tagged , , | 3 Comments

Let IntelliTest generate your tests!

We corrected our function to calculate the GCD so that it now runs correctly. But is the function correct in all the cases? Have we really tested everything? It would be nice if there was a tool that could tell … Continue reading

Posted in .Net, Codeproject, Debugging, Development, Methodology, Testing | Tagged | Leave a comment