Mock sdbus lib, add unit tests of Connection class.
Introduce mock of sdbus library through extracting its interface. Set up unit tests of Connection class through injection of sdbusMock to constructor. Clients of Connections class should use fabrics instead.
This commit is contained in:
1 parent
8c5c774727
commit
2b83d7ca2d
12 files changed
+529
-35
No files matched your search
@@ -25,6 +25,7 @@
|
||||
|
||||
// Own
|
||||
#include "Connection.h"
|
||||
#include "SdBus.h"
|
||||
|
||||
#include "TestingAdaptor.h"
|
||||
#include "TestingProxy.h"
|
||||
@@ -87,7 +88,8 @@ public:
|
||||
std::unique_ptr<TestingProxy> m_proxy;
|
||||
};
|
||||
|
||||
sdbus::internal::Connection AdaptorAndProxyFixture::m_connection{sdbus::internal::Connection::BusType::eSystem};
|
||||
sdbus::internal::Connection AdaptorAndProxyFixture::m_connection{sdbus::internal::Connection::BusType::eSystem,
|
||||
std::make_unique<SdBus>(SdBus())};
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user