I want to mock ModemManager's dbus interface in my program to test its functionality. I think that most honest way is to create peer-to-peer connection and mock ModemManager's behavior. Is it possible to do it with this library?
Using NewConn you can indeed create a peer to peer connection, and then create a whole mock implementation of a server using this. But that would require lots of test harnessing code and include the overhead of all the D-Bus encoding and decoding, thus more testing this library and not your actual application code.
You can mock away BusObject, which is a kind of large interface, but you can focus on implementing only what your application uses.
Handle this from your own code: e.g. create a ModemManager interface whose real implementation just calls the D-Bus method, then mock it away in tests.
I want to mock ModemManager's dbus interface in my program to test its functionality. I think that most honest way is to create peer-to-peer connection and mock ModemManager's behavior. Is it possible to do it with this library?