title: Simple way to unit test a lazy load property
body: <p>I'm somewhat of a newbie in unit testing. Stumbled upon a problem of unit testing a lazy load property and wondering if there is a simple solution to that:</p>
  
  <pre><code>private SubscriptionType _subscriptionType;
  public SubscriptionType SubscriptionType
  {
      get
      {
          if (_subscriptionType == null ||_subscriptionType.SubscriptionTypeId != this.SubscriptionTypeId)
          {
              if (this.SubscriptionTypeId !=0)
                  _subscriptionType = SubscriptionType.Load(this.SubscriptionTypeId);
          }
  
          return _subscriptionType;
      }
  }
  </code></pre>
  
  <p>I need to test logic in the property (if statements) and not the actual SubscriptionType load functionality - seems like the most obvious approach here would probably be to abstract SubscriptionType.Load and use some type of IoC to replace with a mock method.
  I'm just wondering if there are any simpler ways to avoid this kind of refactoring - seems like somewhat of an overengineering just to write a correct unit test case.
  Your thoughts?
  Thanks! </p>