Howdy. The last few days has been hot, really hot! Luckily the rivers are close by and it is always fun to jump off the cliff to river once in a while :)

Code for this post is in branch: learning-unbeered-10.

I added a new feature - “Alert when I have beers for three consecutive days”. This turned out to be simpler than I had thought, thanks to the event driven style! All I had to do was add in a new class, ReportConsecutiveBeering that handled - NewEntryAddedNotification event. I’ve a simple counter(_currentStreak) that tracked the running streak by either incrementing when beered, or reset if no beers! Finally, a check to see if it has been three days in a row. We didn’t have to make any changes to existing code in our application!

Other improvements:

  • Updated nuget packages

Whats next?

I’d like to start tracking when I had too many beers and when I beer consecutively! I can publish events “HadTooManyBeers” and “BeeredConsecutively” instead of just outputting to console. When these events occur, I can store the data and eventually be able to look at historic data, trends etc.