My new Pluralsight course Stateful Reactive Concurrent SPAs with SignalR and Akka.NET was just published, this brings my total number of courses to 30.
I’ve always loved teaching and sharing and being a Pluralsight author is a great way to continue to do this.
I’d also like to take a moment to say a thankyou to everyone that’s watched my courses and for all the kind words. Thank you.
If you’ve already watched my Akka.NET fundamentals Pluralsight course and want to learn more about using DI and logging, check out my new Implementing Logging and Dependency Injection in Akka.NET course.
Akka.NET makes building concurrent and distributed applications easier. As with other architectures, Akka.NET based systems need effective logging for the monitoring and diagnosing of systems when deployed to production. Just because we use Akka.NET to get the benefits of the Actor Model, it doesn’t mean that best practices for object construction and dependencies such as dependency injection should be ignored. By the end of the course, you’ll understand how to implement effective logging in your Akka.NET system and how to use dependency injection to ensure the services your actors depend on are still provided in a loosely coupled and configurable way.
My new Pluralsight course was just published which shows how to use the open source Polly library.
Polly is a great library by Michael Wolfenden for configuring the automatic retrying of operations if exceptions occur. Transient errors such as the network being slow/unavailable for a small amount of time can normally result in errors surfacing to the user and/or into log files that need looking at.
By using one of the exception handling strategies that Polly provides, these transient exceptions can automatically be retried, preventing user errors and/or log entries.
There are four strategies:
- Retry Forever
- Wait and Retry
- Circuit Breaker
Polly is configured in a fluent way, for example to use the Wait and Retry strategy to retry 3 times waiting 2, 4, and 6 seconds between retries:
Check out the Polly GitHub repo, the NuGet package or the “Better User Experiences and More Robust Applications with Polly” Pluralsight course.
My new Pluralsight testing course was just released: Better .NET Unit Tests with AutoFixture: Get Started.
AutoFixture is an open source library that allows the simplification of automated .NET tests. It allows for the creation of “anonymous” test data. This is data that is required for the test to execute, but where the exact values are unimportant.
AutoFixture is not dependent upon any specific testing framework, so can be used with xUnit.net, NUnit, MSTest, etc. There are some additional extensions for specific testing frameworks such as xUnit.net that allow further reductions in unit test setup code.
For more info check out the GitHub site or the Pluralsight course.
If you like AutoFixture be sure to give open source thanks to Mark Seemann.
Feature toggles (also referred to as feature flags, flippers, feature switches, etc) are a technique to turn on or off features in applications. One way of categorising feature toggles is whether they are for the benefit of the development team (“release toggles”) or the business/stakeholders (“business toggles”). Release toggles are an alternative/compliment to feature branching and are short lived. Business toggles are long lived and represent application features that are enabled depending on business defined rules.
In my new Pluralsight course Implementing Feature Toggles in .NET with FeatureToggle I talk about the different types of toggles and some general things to consider when using toggles, followed by modules showing how to use the FeatureToggle open source library.
If you are just dipping your toe in the water when it comes to testing .NET applications it can be a bit confusing. In addition to learning how and what to write test, you also have to learn a testing framework such as MSTest, xUnit.net, NUnit, etc.
My new beginner Pluralsight course helps you to get started with testing in .NET and how to use the NUnit testing framework.
Watch the course at the above link or get to it from my Pluralsight author page.
My new Pluralsight course Automated ASP.NET MVC Testing: End to End was just published.
The course looks at tools and techniques to be able to tests models, controller actions, Razor view rendering logic, and implement automated functional UI browser testing.
The course wraps up by showing how to design and implement a continuous integration build in TeamCity that runs the tests created during the course.
Check it out the full table of contents.
In a test, we are often testing (asserting) individual items such as an (int) age is correct or a string matches an expected value.
If we are practicing test-first development we’ll write our asserts first.
Approval tests allow us to go beyond simple asserts.
What if the thing we’re checking is not a simple value, for example that a pie chart image matches the input data? Or what if we want to use our human judgement to decide when something looks correct, something that is hard to codify in one or more basic asserts?
ApprovalTests for .NET can be install via NuGet. Once installed, it gives us a whole new world when it comes to checking the output of code.
For example, say we are developing a class to represent a stickman. We want to be able to tell an instance to raise left arm or raise right leg for example.
Example of Using Approval Tests
So lets start with a test:
public void ShouldHaveDefaultPosture()
var sut = new StickMan();
And an empty StickMan:
public class StickMan
Here we’re using xUnit.net (the [Fact] attribute) but you could be using NUnit for example.
The first thing to notice here is there is no traditional Assert method, instead we’re using Approval Tests to verify the state of the system under test (sut).
The other think to notice is the [UseReporter] attribute that tells Approval Tests to use a diff tool to display errors when a test fails.
If we run this test, we’ll get a diff tool opened:
My new Pluralsight course Making .NET Data Types More Human With Humanizer was recently released.
With Humanizer our application user experience can be improved. For example we’ve all seen (and probably written) applications that just add “(s)” to a list of things: “1 order(s)” rather that adding the “s” only when there is more than 1 order.
Another use case is the Humanization of DateTimes. For example in a logging application we’d probably want the log entry date and time right down to the millisecond. In a Twitter app for example, that level of detail is not essential to the user experience; in this instance Humanizer can give us a string such as “2 hours ago” which is a lot easier on the eye.
Check out the GitHub site, give a shout out to the creator Mehdi Khalili on Twitter, or watch the Pluralsight course here.
My newest Pluralsight course was just released today: Building the Right Thing in .NET with TestStack.
TestStack is a suite of tools to help the team build better software.
The super-friendly members of TestStack are:
- Jake Ginnivan
- Krzysztof Koźmic
- Mehdi Khalili
- Michael Whelan
- Robert Moore
TestStack consists of the following tools:
- BDDfy: turn tests into business readable, living documentation
- Seleno: automated UI web testing with strongly-typed page object models
- FluentMVCTesting: unit test ASP.NET MVC controllers using fluent syntax
- White: automated UI testing for Win32 based rich client applications
- ConventionTests: write tests to check coding conventions are being adhered to
To get started learning the TestStack tools check out the Pluralsight course, the documentation site, or learn how to contribute to the TestStack project.