title: Test case fails but works in WCF Test Client
body: <p>I have a WCF service and I have written some basic test cases. They call to a database and returns some values. Here is one:</p>
  
  <pre><code>public void TestGetDevicesByToteNumber()
      {
          IService1 service = new Service1();
          List&lt;Device&gt; devices = service.GetDevicesByToteNumber(5467);
          Assert.IsTrue(devices.Count &gt; 0);
          foreach (Device device in devices)
          {
              Assert.IsTrue(device.ToteNumber == 5467);
          }
      }
  </code></pre>
  
  <p>The implementation is:</p>
  
  <pre><code>private ZebraServiceApplication.DAL.DHLScannerContext db = new ZebraServiceApplication.DAL.DHLScannerContext();
  
  public List&lt;Device&gt; GetDevicesByToteNumber(int toteNumber)
      {
          List&lt;Device&gt; devices = db.Devices.Where(x =&gt; x.ToteNumber == toteNumber).ToList();
          return devices;
      }
  </code></pre>
  
  <p>Using WCF Test Client everything works fine and I get back the expected list of devices. 
  When I run the test from Test Explorer I get no devices.
  Any help would be appreciated.</p>