NSubstitute Logo

How to Mock using NSubstitute

Unit tests are code written to test small pieces of functionality of big programs. Performing unit tests is always designed to be simple, A “UNIT” in this sense is the smallest component of the large code part that makes sense to test, mainly a method out of many methods of some class. Unit tests take milliseconds, can be run at the press of a button, and don’t necessarily require any knowledge of the system at large. And when writing unit tests, you need to focus on the UNIT at hand and not consider other dependencies like services or variables. To accomplish that we need to use mocking. There are many Mocking frameworks out there, but today we will check NSubstitute. ...

November 4, 2022 · 2 min · Mohamad Dbouk
CLI

Build your own cli because you can

I have always been impressed by the Azure CLI and how it has played a significant role in my DevOps journey over the years. That got me wondering, how can I build my own CLI in a similar vein to Azure? Follow along in this blog post where I’ll be sharing my step-by-step process for creating a CLI using C# in .NET. Don’t miss out on this exciting adventure! What is CLI A command line interface (CLI) is a text-based user interface used to run programs, manage computer files, and interact with the machine. Back in the day, everything was done on a computer using a CLI, there was no GUI (Graphical User Interface) and the user should learn how to use a CLI to perform different actions on the computer. Nowadays, CLI has become wildly used specifically for a developer or a technical person. Some of the great CLI out there are dotnet, git, GitHub, azure cli, and others. ...

September 26, 2022 · 11 min · Mohamad Dbouk
BenchmarkDotNet Logo

Let’s benchmark .NET using BenchmarkDotNet!

In this blog, we will deep dive into BenchmarkDotNet package and see how it can help us improve our dotnet application. What is Benchmarking? Benchmarking is the act of comparing similar products, services, or processes in the same industry. When benchmarking it is very essential to measure the quality, time, and cost. Benchmarking will let you know if you are working on the latest and best practices across other parties in the same industry and it will help you identify your strengths and weaknesses. ...

September 15, 2022 · 5 min · Mohamad Dbouk