Observer Design Pattern with an example in CSharp

Observer design pattern

Definition Observer design pattern defines a one-to-many dependency between the objects. When the object state changes, the observers are notified/updated about the change. Observer Pattern Terminology The observer pattern will have a subject, concrete subject, observer, and concrete observers. Subject: The subject is the interface that will be implemented by the concrete subject. Concrete subject: … Read more

Configuring Dependency Injection in .NET Core Console Applications

Configuring DI in .net core console applications

.NET Core console applications do not have a startup file to register the dependencies. In this post, we’ll see how we can create a dependency injection setup in .net core console applications. A use case for this post For this post, let’s create two services one that gives a message (MessageService) and the other to … Read more

How to Mock an AXIOS call with Jest in vue tests utils

Mocking an axios API call in Jest with vue test utils

In this post, we will see how to mock an Axios call with Jest in vue-test-utils library. For this article, let’s create a Posts.vue component which will call the JSONPlaceholder’s /posts API. The /posts API will return an array of objects. Each object in the array is a post with id, title and body. Here … Read more