As multi core processor and computers gain prevalence, the topic of Parallelism become more important. It allows us to use the computing resource we have available to the fullest. So by release of xUnit 2, we have the ability to run the tests in parallel. In this version, the tests are gathered into collection, and …
C#
XUnit – Part 3: Action Based Assertions Assert.Raises and Assert.Throws
In my previous post, we saw how value and type based assertions works in xUnit. In this post I’m going to focus on assertions that check whether or not something happened. Specifically we look at assertions to check if an event is raised or an exception is thrown. Asserting if An Event Is Raised Let’s …
XUnit – Part 1: xUnit Packages and Writing Your First Unit Test
I one of my previous post I said I’m going to write a series of articles on xUnit. I’m going to start from the begging which is installing xUnit packages. I’m also going to explain a little about other frameworks that might be used with xUnit to complement it. In the future I’ll go in …
Using Google Indexing API With Google API Client Library for .NET
Normally websites get indexed by google automatically. There’s also sitemap to help us announce what should be crawled by google or certain pages exist on our website. For each update of our website the search engine crawlers from google visit our website and update their indexes with our pages information. But waiting for google bots …
Apply With LinkedIn: A Guide With Sample App
Recently my company wanted to use the Apply with LinkedIn feature on one of our ATS modules. This feature allows the applicant who want to apply for a job posting to fill the application form using their LinkedIn data. This saves them time by receiving their info from LinkedIn and filling the form instead of …
Lambdas vs Local Functions What’s the Difference
We already had the ability to create a short anonymous methods that assigned to a variable in C#. We could achieve this using delegate keyword or using Action and Func. But with release of C# 7 local functions got introduced. It has some similarity to lambdas but also some major differences. Local functions are functions …
Functional Programming in C#: A Brief Guide
Functional Programming and its concepts are becoming more important to software industry and data driven applications. But for us to be able to benefit from functional programming we don’t have to use a strictly functional language like Haskell for example. We can follow the principles and patterns of functional programming even in object oriented languages …
C# in parameter modifier
In version 7.2 of C# language, now we can pass an argument into a method without allowing the method to mutate the value. But the main reason this keyword is added to the language is not mutability. It was added for optimization and the need to pass a value type in a method by reference …
Moq: What’s Wrong With Using VerifyAll
There are some features in the isolation framework (Mocking framework) Moq which I see is used blindly. Most of the time it can which reduce test readability and maintainability. One of the worst offender in this regards is VerifyAll. In this post I’m going to elaborate why this method is so pernicious to readability and …
Stop Using Repository Pattern With an ORM
There a tendency in software developers to want to follow a specific formula. Whether it is adhering to a methodology like agile or using a specific design pattern. This happens so often that we have a specific term for it in our field called Cargo cult programming. In these situation a programmer don’t ask themselves …