Category: Uncategorised

SpecFlow tests for .NET Core Web Apps with Playwright

Specflow is a fantastic framework for codifying your requirements. It allows writing human-readable scenarios which map to C# code. This, coupled with a browser automation tool like playwright, puppeteer, or selenium can create an incredibly powerful and versatile testing framework. In this article, I’ll show you how to set up a basic test framework for

Continue Reading

Internals Visible To in *.csproj

Making internal methods and properties visible in tests gives a finer level granularity of tests hopefully making them less coupled and more cohesive as well as more focused on what they are testing. This is without making the API visible to the outside. In the older days, we used add into the 'Assembly.cs'

But

Continue Reading

Clean Architecture in .NET Core 3.0 by Jason Taylor

This video is truly one of the best ones I've ever seen. I am not fully sold on using EF Context everywhere. There are quite a few databases (e.g. MongoDB, ElasticSearch) that do not have an EF Driver. However, since .NET Core has amazing support for integration testing and each handler is nicely isolated, so

Continue Reading

ToByteArrayAsync() - a more 'efficient' approach to converting Streams

Frequently, there is a need to convert a stream into an array of bytes. I came across this problem when uploading files in ASP.NET Core. StackOverflow has certainly a number of answers. In most cases, these answers require copying the array, which is no longer needed. .NET Core 2.0 introduced the concept of Span<T> and

Continue Reading

Maintaining user session on msdeploy in ASP.NET Core (in SQL Server)

Using TeamCity, Bitbucket and msdeploy, I have been able to develop a satisfactory CI process for my web apps. However, I found that whenever an application was deployed to production, the user sessions would expire. Initially, it was not a big issue, but as the number of users grew so did the issue. We want

Continue Reading

Is my code not working?

Continue Reading

(Joke) How to force users to provide hard passwords?

Continue Reading

StackOverflow Survey is here

If you haven't seen already, StackOverflow has released their annual survey. It offers a valuable insight into the minds of other programmers, so don't forget to check it out! http://meta.stackoverflow.com/questions/342400/take-the-developer-survey-2017

Continue Reading

How to assess complexity of your software

No Silver Bullet — Essence and Accidents of Software Engineering Fred Brooks This is one of the famous quotes by Turing Award-winning Fred Brooks. The complexity of software is tough to define. It is a measure of your program which is partially about the size and partially about understandability (clarity) of the code. A complex

Continue Reading