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:
ardazishvili
2019-03-17 18:02:47 +03:00
parent 8c5c774727
commit 2b83d7ca2d
12 changed files with 529 additions and 35 deletions
@@ -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())};
}