Order Processing Testing – Moq 4 and xUnit

I am reading, experimenting and hopefully learning how to use Moq is a mocking framework for C#/.NET. To learn more about mocking objects read here. For additional documentation on moq4 read here.

After completing the PluralSight course “Mocking with Moq 4 and xUnit” I decided to look for examples of Moq mocking a database. This post is based on my experience and comments on the article Unit Test Through Mocking Using MOQ Framework by Chinmay Dey published Dec 26, 2018. Continue reading “Order Processing Testing – Moq 4 and xUnit”

Calculator in C#

In this post we will develop a simple calculator able to add, subtract, multiply and divide.

The code will be implemented in C# using Visual Studio 2022.

Once we have the main code operational, we will add xUnit and will test using Moq4.

Let’s start by showing some output from our simple calculator. Continue reading “Calculator in C#”

Notes from the UnsafeCSharp Presentation

At work each month a set of hours are set aside/scheduled for employees to learn something new. I have worked at more than a dozen companies and have never seen a periodic time scheduled in the company calendar for it. Yesterday we had eight hours scheduled for learning. During that time an invite for a one hour presentation UnsafeCSharp showed up. I watched and enjoyed it. In addition most presentations at work are recorded so I am planning on watching it again later today.

As I am writing this post I am not sure if there are things that were presented that are company confidential. For that reason, at this time I am not disclosing the name of the presenter or will dive into specific topics. Continue reading “Notes from the UnsafeCSharp Presentation”

Async and await in C#

When developing a software product or service, system architects need to decide to build or buy the pieces / components needed to develop and deploy the solution. I am stretching this well know strategy to a set of events in my personal life that occurred a month or two ago.

A few years my oldest son and I went to a barber shop once a month. The small place has two chairs. With time only one was being used. At some point the barber decided that he was about to retire. We had to look for an alternate place. Continue reading “Async and await in C#”

Symbolic Links on .NET

word_to_pdfI was talking with a colleague earlier today. A few days ago the requirements for a short project specified a service / application that would monitor an input folder (e.g., c:\temp\DocFolder) for *.doc (Word) files and generate in an output folder (e.g., c:\temp\PDFFolder) a *.pdf (Portable Document Format) version of the files. The application / server was implemented and tested. Continue reading “Symbolic Links on .NET”