Fun with timespan

Introduction and caveat Timespan is a .NET object that can be used to represent a time interval. For example, a 15:00:00 is a timespan that represents 15 hours. However, I feel that the way timespan works when trying to create a time interval of 24 hours or more is a bit weird. Instead of 24:00:00 representing 24 hours, .NET instead assumes this is 24 days. This can be quite confusing when someone tries to create a Timespan to represent 24 hours and uses 24:00:00 it’ll turn out to be 24 days....

March 27, 2022 · 1 min · Samuel Tambunan

What's new in .NET 6

.NET 6 .NET 6 should be released during .NET Conf 2021, which is between November 9 - 11. Currently, we can download previews for .NET 6 from the link. The idea for .NET 6 is to consolidate all the platforms that .NET currently has; Core, Framework, Standard, and unify them in one single framework. What’s new in .NET 6? Hot reload The hot reload function that will be introduced by ....

August 8, 2021 · 2 min · Samuel Tambunan

Using Environment Variables in XUnit

When I was creating unit tests for a .NET Core lambda, I had to be able to unit test with the Environment.GetEnvironmentVariable(). The best practice would have been to decouple this and have an IEnvironmentService which would be able to get all the values out. This way, you would be able to mock out the IEnvironmentService to retrieve values. However, as I wasn’t able to do this, due to the limitations of the current project and timelines, I had to use Environment....

October 3, 2019 · 1 min · Samuel Tambunan