Hello @Muhammad Guruh Ajinugroho ,
both classes do not implement a base class or interface:
public class RegistryManager : IDisposable
public class ServiceClient : IDisposable
It works with the Factory method design pattern, not with constructors.
Thus, writing unit tests will be hard.
Although still in preview, please check out Microsoft Azure IoT SDKs for .NET v2 Preview Release
It seems this new V2 version better suites your needs:
Additionally, all clients can be created using a constructor; factory methods are mostly gone. This enables easier discovery of client initialization as well as unit test mocking.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.