Here you can find my private notes about programming that I wanted to share with you. Feel free to filter based on the topic you want or search for something specific.
6 tips and tricks for better unit-testing while using the Moq framework
Moq is probably the most known framework for mocking functionality which is then used in your unit-tests. In this article you can find some of my notes about Moq that I wanted to share with you.
Create a real-life example (Function, Service Bus Queue, Storage Table) of an Azure Logic App. A step to step example.
Some time ago I wrote an article with an example of an Azure Function which I used in my applications. With the current article I want to present you another real-life example of using different Azure Services and combining them together in a Logic App.
A Logic App represents a workflow of steps that are defined to be done in a sequential or in a parallel manner.
Our scenario contains a company which owns an eshop. We are going to build a workflow for getting customer orders, pushing them into a queue for almost-real-time process (A queue is a good way to balance load of large number of requests in your servers), retrieving them back, storing them in a storage table and informing the user about her order with an email. The most important thing, we are going to develop all the steps inside the Azure Portal; the use of Visual Studio is optional.
After we finish with the creation of our Logic App, we are going to have the following workflow:
3 simple ways to improve your productivity and the code quality when writing JavaScript in Visual Studio 2017
Writing JavaScript code without any type analysis superset like TypeScript or Flow is still a thing and in my opinion absolutely valid and welcome decision. Without types there are some implications while coding in JavaScript. Visual Studio does a great job for providing Intellisense and F12 functionality for the files which reside in the same project. We can improve the quality of our code even more.
JavaScript IntelliSense in Visual Studio 2015 and 2017 - The current stand, as of 2018
If you are writing vanilla JavaScript in a large web application, it is almost certain that you are dealing with multiple JavaScript files which are scattered in multiple Visual Studio projects, stored in different solutions. Visual Studio does not provide any IntelliSense features for referenced code which sits outside of the current project.
One solution to this problem is to manually search for the specific file and find out which arguments does your function need or which functions are contained in a JavaScript object. Since this can be a tedious action, Visual Studio gives us the option to activate IntelliSense in our JavaScript files by creating a file named _references.js. TypeScript users are already experiencing the benefits of code completion by using the d.ts definition files.
The use of _references.js is not a new feature. It exists for many years now, however, with this article I want to give you the current stand of the feature, as of 2018. I want to find out if the file still does what is supposed in Visual Studio 2015 and 2017.
How to pass and read query parameters from one page of your application to another by using the React Router
In this post we are going to see how you can register a new route in your React application and then pass information with the help of query parameters from one subpage to another.
Let us suppose the following scenario. You have page that contains a list of products with some basic information. You want to be able to click on an item of this list and navigate to a details-page, where the user can find more details about a specific product.
The following code examples are written in TypeScript. Visual Studio provides a great starting template for your React projects. I used the 4th generation of the React Router
First we need two routes for the scenario we just mentioned. The first route loads all the products, with only a limited information for each of them, from our backend and the second one loads the all the details to one product: