Author Archives: Gaston

About Gaston

MCT, MCSD, MCDBA, MCSE, MS Specialist

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

How to set up a Parameterized Unit Test

In my previous post we saw how to set up unit testing using Visual Studio. The code we want to test is a (simple) function to calculate the greatest common divisor, and we wrote our first test. The test we … Continue reading

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

Setting up unit testing

Introduction In the previous posts I talked about unit testing. I gave some background, and I explained the flow of Test-driven Development (TDD). So now is the time to set things up. In this article I will use the calculation … Continue reading

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

Test Driven Development

I talked about the necessity of testing in my previous post. I’ll talk about how we can implement TDD in our project in this post. When we talk about testing, there are a lot of tests that we can perform. … Continue reading

Posted in Codeproject, Development, Testing | Tagged | Leave a comment

Is testing a waste of time?

tl;dr:  NO Let’s elaborate As developers we all know that we’re supposed to test our code. We should write unit tests and yet usually this is the first action that we skip when we’re running out of time. As team … Continue reading

Posted in Codeproject, Development, Methodology, Testing | Tagged | 1 Comment

State Chart Diagram Part II

In part I we covered state chart diagrams in a basic way. Usually this is good enough to describe your states. You also want to keep thing simple (KISS). On the other hand it can be convenient to be able … Continue reading

Posted in Analysis, Codeproject, Development, OOAD, UML | Tagged | Leave a comment

How to describe object state

Let’s say that we’re developing an application to manage invoices. Invoices will be created, modified, sent, (hopefully) paid or rejected, … Depending on the stage that an invoice is in, we can perform different actions on it. For example: it … Continue reading

Posted in Analysis, Codeproject, Development, OOAD, UML | Tagged , | 1 Comment