Category Archives: Unit Test

Unit Test – How to test Azure Functions

By | 18/12/2024

In this post, we will see how to create Unit Test for an Azure Function named “GetListInt”, using Moq, xUnit, and Fluent Assertions.This function is triggered by HTTP requests and takes two query parameters: to and Type. Based on these inputs, it generates a list of integers that are either odd or even, depending on… Read More: Unit Test – How to test Azure Functions »

Unit Test – How to test a Private method in C#

By | 17/04/2024

In this post, we will see how to test a Private method in C#, using Reflection.In unit testing, the conventional wisdom is to test the public interface of a class. This means that private methods, which are implementation details, are typically tested indirectly through public methods. However, there are times when we might want to… Read More: Unit Test – How to test a Private method in… »

Unit Test – How to use “In Memory Database Provider” for testing in C#

By | 01/04/2020

In this post, we will see how to use In-Memory Database Provider for Unit Test. We start creating a Blank Solution called ProjectDemo and then, we add a Class Library (.NET Core) called Entities where we will define a class called Retailer: [RETAILER.CS] Then, we add another Class Library (.NET Core) called Data where we… Read More: Unit Test – How to use “In Memory Database Provider”… »