---
title: "Discussion on \"NSubstitute - make async method (Task) throw an exception\" | Hashnode"
description: "Discussion on \"NSubstitute - make async method (Task) throw an exception\". The other day I was writing a unit test to verify what was supposed to happen when a Task would throw an exception when awaited. It wasn't as straight forward as I first assumed, but I quickly found this Stack Overflow post that helped me:\nhttps://st..."
url: "https://hashnode.com/posts/nsubstitute-make-async-method-throw/628e2c2c19bda58ac7fb0f72"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [NSubstitute - make async method (Task) throw an exception](https://blog.krusen.dk/nsubstitute-make-async-method-throw?utm_source=hashnode&utm_medium=feed)

The other day I was writing a unit test to verify what was supposed to happen when a Task would throw an exception when awaited. It wasn't as straight forward as I first assumed, but I quickly found this Stack Overflow post that helped me: https://st...

Dec 12, 2020 · 3 min read · blog.krusen.dk  
Read the article

## Written by

[Søren Kruse](https://hashnode.com/@Krusen)

@Krusen · Odense, Denmark

  
[View profile](https://hashnode.com/@Krusen)

Tech Lead @ IMPACT Commerce

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
