Category: Instruction

  • Build Resilient Applications with Polly

    Build Resilient Applications with Polly

    Do you build resilient applications? If so, do you use Polly? If not, are you certain they’re actually resilient? (and yes, I admit I’m being a bit provocative just to get your attention.) I work as a software engineering consultant for the Application Services division of World Wide Technology. We had an internal conference scheduled […]

  • An Accommodating Approach to Pagination

    An Accommodating Approach to Pagination

    In the previous post from this series I showed you a “quick and dirty” implementation of API endpoint pagination. It definitely left much to be desired. As promised, in this post I’ll illustrate a much more accommodating approach to pagination that includes interfaces, extensions, generics, input validation, safety checks, and a courteous response. Let’s jump […]

  • Quick and Dirty Pagination

    Quick and Dirty Pagination

    Let’s say you have an endpoint on your API that returns a list of objects, and it’s just no longer reasonable to expect it to return the entire list at once. It’s quite possibly time to introduce pagination. If you’ve never done this before it may sound a bit intimidating, but it doesn’t have to […]

  • Make Assertions, Not Assumptions

    Make Assertions, Not Assumptions

    The key to writing a good unit test is to make assertions, not assumptions. Don’t assume that the function will handle any and all arguments gracefully. Or that another dev would never call the function for a purpose other than what you’ve intended. Don’t assume that another dev would never try to add to or […]

  • Set Up a Unit Test Project

    Set Up a Unit Test Project

    After reading the first part of this series you should have a better understanding of the purpose and usefulness of unit testing, as well as a familiarity with our example situation. So now we’re tasked with writing unit tests for the CastVote function. After all, we want the electorate to be confident in the integrity of […]

  • An Introduction to Unit Testing

    An Introduction to Unit Testing

    Never written a unit test? Don’t see what all the fuss is about? Or perhaps you’ve written a couple, but you’re not quite sure if they’re actually testing anything? Well, over the course of the next few posts let’s see if we can remedy that. In this example, we’re going to be using the xUnit.net […]

  • Create a Two-Way Communication Demo

    Create a Two-Way Communication Demo

    I recently gave a Lunch-and-Learn at work on a .NET resilience and transient-fault-handling library called Polly. As I was preparing, I found myself needing to create a two-way communication demo showing an app talking to an API.