0

I have a problem,

I will test this public function:

bool FeatureManager::isFeatureActivated(CString section, CString key)
{
    bool isActivated = false;
    char  returnedString[MAX_PATH] = _T("");
    CString  path = getPath();
    path.Replace("\\", "\\\\");
    path += "InternFeatures.ini";
    
    if (GetPrivateProfileString(_T(section), _T(key), "", returnedString, sizeof(returnedString), _T(path)))
    {
        CString currentValue = returnedString;
        if (currentValue == "{ja}")
        {
            isActivated = true;
        }   
    }

    return isActivated; 
}

the getPath is a private method, now the first question how can I Mock the getPath method.

CString FeatureManager::getPath()

and the GetPrivateProfileString is a WinBase.h method, and this is the second question, how can I mock this?

273K
  • 29,503
  • 10
  • 41
  • 64
jdeber
  • 1

0 Answers0