title: Unit Testing a Static Method of a Static Class
body: <pre><code>public static class ApplicationUtils
  {
     public static bool IsCurrentUserAManager()
          {
              var username = WindowsIdentity.GetCurrent().Name;
  
              bool inAdmin;
  
              if (username == "AdminUser") {
                 inAdmin = true;
              } else {
                 inAdmin = false;
              }
  
              return inAdmin;
          }
    }
  </code></pre>
  
  <p>Above is some code that is used to test if the currently logged in user is an Admin, I want to unit test this section by passing in a different username and test if the result is correct.</p>
  
  <p>I have heard that dependency injection would be the best way to do this. But I have no idea how to dependency inject into a static class and a static method.</p>
  
  <p>Can anyone help me fill out the TestMethod below in order to pass in a username and test the method?
  (<strong>Not using enterprise</strong>)</p>
  
  <pre><code>[TestMethod]
  public void IsCurrentUserAManagerTestIsAdmin()
  {
  
  }
  </code></pre>