Category Archives: OOAD

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

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