mercredi 23 décembre 2015

Mock directory attributes using c#

I am writing a unit test case for my application. I want to mock Attributes of DirectoryInfo.

Please, any one help me to write mock unit test case for following method. Method:

 public void CheckPermissionOnFolder(string strDrivePath)
    {
        string strObjectName = string.Empty;
        try
        {
            Directory.CreateDirectory(strObjectName).Attributes |= FileAttributes.Hidden;
        }
        catch
        {}
    }

Aucun commentaire:

Enregistrer un commentaire