title: MSTest Unit test for DsGetSiteName AD functionality
body: <p>How to do unit test [MSTest] for the below method. If I do check the full AD functionality it will be kind of Integration or End to end testing ?</p>
  <p>In the test method, i don't want any specific machine to take dependency from but still want to write unit test. i read that We can use moq to check external dependency, do we have use the moq here or anything else ?  Any pointers would be helpful</p>
  <pre><code>[DllImport(&quot;netapi32.dll&quot;, CharSet = CharSet.Auto)]
  private static extern int DsGetSiteName(String ComputerName, out IntPtr SiteName);
  
  [DllImport(&quot;netapi32.dll&quot;, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
  private static extern int NetApiBufferFree(IntPtr dwBuffer);
  
  public static String GetSiteName(String computerName = &quot;&quot;) {
      IntPtr ptr;
      String siteName;
      int NO_ERROR = 0;
  
      int ret = DsGetSiteName(computerName, out ptr);
      if (ret == NO_ERROR) {
          siteName = Marshal.PtrToStringAuto(ptr);
          NetApiBufferFree(ptr);
      }
      else
          throw new System.ComponentModel.Win32Exception(ret);
  
      return siteName;
  }
  </code></pre>
  <p>Calling GetSiteName from SiteInfo.cs file to get the Site name.</p>
  <pre><code>[TestMethod]
  public void TestSiteInforToGetSiteName()
  {
   string hostname = {what should machine for generalize pupose here} ; 
   string actualValue= &quot;xyz&quot; {Based on the above machine name, specify the site name};
   string expectedValue = SiteInfo.GetSiteName(hostname);
   Assert.AreEqual()
  }
  </code></pre>