In both the cases displayed above i.e. PrivateObject and PrivateType the method names are hardcoded. In order to avoid hard coding Visual Studio provides an option to create private accessor as displayed below where PrivateBanking is the name of the project.