title: Unit-testing of a constructor
body: <p>I'm working on a laboratory practical with unit-testing, and below is a piece of code from the application that i'm testing. Most of the unit-testings are finished, but regarding the constructor below I just can't figure out how to test it. For example, what exactly is the constructor doing with the array elements? What would be a good way of testing the construtor? </p>
  
  <p>Is there maybe a kind soul out there who could give me a kick in the right direction?</p>
  
  <pre><code>  public struct Point { 
      public int x, y;
  
      public Point(int a, int b) {
        x = a;
        y = b;
      }
    }
  </code></pre>
  
  <p>...</p>
  
  <pre><code>  public Triangle(Point[] s) {
      sides = new double[s.Length];
      sides[0] = Math.Sqrt(Math.Pow((double)(s[1].x - s[0].x), 2.0) + Math.Pow((double)(s[1].y - s[0].y), 2.0));
      sides[1] = Math.Sqrt(Math.Pow((double)(s[1].x - s[2].x), 2.0) + Math.Pow((double)(s[1].x - s[2].x), 2.0));
      sides[2] = Math.Sqrt(Math.Pow((double)(s[2].x - s[0].x), 2.0) + Math.Pow((double)(s[2].x - s[0].x), 2.0));
    }
  </code></pre>
  
  <p>...</p>
  
  <pre><code>        [TestMethod()]
          public void TriangleConstructorTest1()
          {
              Point[] s = null; // TODO: Initialize to an appropriate value
              Triangle target = new Triangle(s);
              Assert.Inconclusive("TODO: Implement code to verify target");
          }
  </code></pre>