title: Divide by zero and no error?
body: <p>Just threw together a simple test, not for any particular reason other than I like to try to have tests for all my methods even though this one is quite straightforward, or so I thought.</p>
  
  <pre><code>    [TestMethod]
      public void Test_GetToolRating()
      {
          var rating = GetToolRating(45.5, 0);
          Assert.IsNotNull(rating);
      }
  
  
      private static ToolRating GetToolRating(double total, int numberOf)
      {
          var ratingNumber = 0.0;
  
          try
          {
              var tot = total / numberOf;
              ratingNumber = Math.Round(tot, 2);
          }
          catch (Exception ex)
          {
              var errorMessage = ex.Message;
              //log error here
              //var logger = new Logger();
              //logger.Log(errorMessage);
          }
  
  
          return GetToolRatingLevel(ratingNumber);
      }
  </code></pre>
  
  <p>As you can see in the test method, I AM dividing by zero. The problem is, it doesn't generate an error. See the error window display below.</p>
  
  <p><a href="https://i.stack.imgur.com/Fjx6O.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Fjx6O.png" alt="Error List View from VS2017"></a></p>
  
  <p>Instead of an error it is giving a value of infinity? What am I missing?So I googled and found that doubles divided by zero DON'T generate an error they either give null or infinity. The question becomes then, how does one test for an Infinity return value?</p>