title: TDD - Why does this Assert.AreSame pass?
body: <p>I have a test method...</p>
  
  <pre><code>[TestMethod]
  public void MainViewModel_PropertiesReflectDataEntityProperties()
  {
      // Arrange
      var facilityDataEntity = MockRepository.GenerateStub&lt;FacilityDataEntity&gt;();
      var shopOrderDataEntity = MockRepository.GenerateStub&lt;ShopOrderDataEntity&gt;();
  
      // Act
      MainViewModel mainViewModel = new MainViewModel(facilityDataEntity, shopOrderDataEntity);
  
      // Assert
      Assert.AreSame(facilityDataEntity.Value, mainViewModel.FacilityValue);
  }
  </code></pre>
  
  <p>... and the test passes. However, I have not implemented the mapping of the DataEntity's properties to the MainViewModel's properties yet! How can this be? I thought AreSame checks whether two references point to the same instance.</p>
  
  <pre><code>public class MainViewModel
  {
      private readonly FacilityDataEntity facilityDataEntity;
      private readonly ShopOrderDataEntity shopOrderDataEntity;
  
      public MainViewModel(FacilityDataEntity facilityDataEntity)
      {
          this.facilityDataEntity = facilityDataEntity;
      }
  
      public MainViewModel(FacilityDataEntity facilityDataEntity, ShopOrderDataEntity shopOrderDataEntity)
      {
          this.facilityDataEntity = facilityDataEntity;
          this.shopOrderDataEntity = shopOrderDataEntity;
      }
  
      public ShopOrderDataEntity ShopOrderDataEntity
      {
          get { return shopOrderDataEntity; }
      }
  
      public FacilityDataEntity FacilityDataEntity
      {
          get { return facilityDataEntity; }
      } 
  
      public int ShopOrder { get; set; }
  
      public decimal RequiredQuantity { get; set; }
  
      public string ItemCode { get; set; }
  
      public string ItemDescription { get; set; }
  
      public string FacilityValue { get; set; }
  
      public string FacilityLabel { get; set; }
  
      public static IEnumerable&lt;MainViewModel&gt; TranslateDataEntityList(IEnumerable&lt;FacilityDataEntity&gt; facilityDataEntityList)
      {
          foreach (FacilityDataEntity facilityDataEntity in facilityDataEntityList)
          {
              yield return new MainViewModel(facilityDataEntity);
          }
      }
  
      public static IEnumerable&lt;MainViewModel&gt; TranslateDataEntityList(FacilityDataEntity facilityDataEntity, IEnumerable&lt;ShopOrderDataEntity&gt; shopOrderDataEntityList)
      {
          foreach (ShopOrderDataEntity shopOrderDataEntity in shopOrderDataEntityList)
          {
              yield return new MainViewModel(facilityDataEntity, shopOrderDataEntity);
          }
      }
  }
  </code></pre>