Category: Library

.NET, .NET Core, BDD, C#, CSharp, Library, Programming, Quality, Tests, Unit tests

SpecFlow – BDD in C# – induction

BDD – this acronym stand for Behavior Driven Development. This methology has been built using concepts of TDD (Test Driven Development) and DDD (Domain Driven Design). This type of tests is often done as integration tests (UI tests or API). One of the most popular libraries is SpecFlow. I was using this solution for Xamarin, …

.NET, .NET Core, C#, CSharp, Library, Programming, security

Security Code Scan – open source vulnerability patterns detector

Security Code Scan is open source (LGPL v3.0) vulnerability patterns detector for C# (including .NET Core) and VB.NET. It has two installation modes: either as VS extension or as nuget package (SecurityCodeScan). Instead of writing about types of attacks which it can detect – let’s demo it. As a test application, I created API application …

.NET, C#, CSharp, Library, Programming, Tests, Unit tests

Fluent Assertions in unit tests

As a continouation of the article about unit test frameworks I would like to introduce Fluent Assertions. This framework simplifies testing by BDD style syntax. Let’s start from basic assertion. As you noticed, first is going the result, then the keyword (or rather extension method) Should() and at the end the condition (so in case …

.NET, C#, CSharp, Library, Programming

.NET unit test frameworks comparison

In .NET we have 3 dominant unit test frameworks: MS Test (v2) NUnit (3.x) xUnit (2.x) First one comes with Visual Studio, two other requires additional components installation. Initialize First difference we will find in initialization approach. In MS Test there several initialization available (by attributes): AssemblyInitialize, ClassInitialize and TestInitialize. The disadvantage is that initialization …

C#, CSharp, Library, Programming, REST

Refit as HTTP client

This post is dedicated to my colleague – Łukasz (his blog in Polish). Today I would like to introduce Refit library (GitHub repo). It is described as The automatic type-safe REST library for .NET Core, Xamarin and .NET. In Refit the interface with methods mapped to API actions is declared. I will use HNapi (Hacker …

.NET, C#, CSharp, Library, Programming

Flurl.Http – HTTP unit testable client for .NET

So far the first choice of many people was RestSharp. Since few months new player is getting a piece of market – Flurl. In this post I would like to introduce this library, show how to use with .NET Core 2.0 and unit test the code. Code! Let’s start coding part with getting it – …