public async Task Given_Post_InvalidParameter_When_TryToMakeAPurchase_Then_BadRequestIsReturned() { // arrange // act var actionResult = await purchaseController.PostPurchase(null); // assert Assert.True(actionResult.Result is BadRequestObjectResult); Assert.Equal((actionResult.Result as BadRequestObjectResult).StatusCode, (int)HttpStatusCode.BadRequest); }