title: How to handle thrown exception in NUnit
body: <p>I have written a unit test class in C# for my MVC project.</p>
  
  <p>The Test Method is following</p>
  
  <pre><code> [Test]
      public void To_Add_DocumentStatusIsNull_ThrowsInvalidOperationException_ServiceTest()
      {
          try
          {
  
          _IDocumentStatusRepositoryMock = new Mock&lt;IDocumentStatusRepository&gt;();
          _unitOfWorkMock = new Mock&lt;IUnitOfWork&gt;();
  
          DocumentStatusService documentStatusService = new  
           DocumentStatusService(_unitOfWorkMock.Object,  
            _IDocumentStatusRepositoryMock.Object); 
  
          DocumentStatus documentStatus;
          documentStatus = null;
  
          _IDocumentStatusRepositoryMock.Setup(m =&gt; m.Add(documentStatus));
          documentStatusService.Add(documentStatus);
  
          Assert.Pass();
  
          }
          catch (Exception e)
          {
              throw new Exception(e.Message);
          }
      }
  </code></pre>
  
  <p>And the Service Method is following</p>
  
  <pre><code>   public virtual void Add(TEntity entity)
      {
          try
          {
  
          if (entity == null)
          {
              throw new ArgumentNullException("entity");
          }
          _repository.Add(entity);
  
          }
          catch (Exception e)
          {
              throw new Exception(e.Message);
          }
      }
  </code></pre>
  
  <p>Now This test method only not passed due to the service class thrown ArgumentNullException.So how to handle the ArgumentNullException or How to make this test pass?</p>
  
  <p>Please anybody help</p>