title: Why is this code not good for unit testing?
body: <p>Apparently this code is not good for unit testing, I'm wondering why? What does it mean that a code is &quot;good&quot; for unit testing?</p>
  <pre><code> public class B 
    {
          public int Y { get ; }
          public int X { get ; }
          public B() 
          {
            X = 3;
            Y = 7;
          }
  
          public B(int x) 
          {
            X = x;
            Y = 2 * x;
          }
    }
  
   public class A 
   {
          public B MyB { get ; set ; }
          public A() {MyB = new B ();}
  
          bool M1( int a, int b) 
          {
             if (a &gt; MyB.X) return false;
             if (b &lt; MyB.Y) return false;
             return true;
          }
  
          public B M2(int x) { return new B(x);}
  }
  </code></pre>