TEST_CASE("GEventGenerator core method test battery")
{
GW::GReturn gr;
GW::CORE::GInterface emptyInterface;
unsigned int listenerCount = 0;
GW::CORE::GEventGenerator eventGenerator;
SECTION("Testing Empty proxy method calls")
{
REQUIRE(eventGenerator.Observers(listenerCount) == GW::GReturn::EMPTY_PROXY);
REQUIRE(eventGenerator.Push(GW::GEvent()) == GW::GReturn::EMPTY_PROXY);
REQUIRE(eventGenerator.Register(emptyInterface, nullptr) == GW::GReturn::EMPTY_PROXY);
}
SECTION("Testing Creation/Destruction method calls")
{
REQUIRE(eventGenerator.Create() == GW::GReturn::SUCCESS);
REQUIRE(eventGenerator);
eventGenerator = nullptr;
REQUIRE(!eventGenerator);
REQUIRE(eventGenerator.Create() == GW::GReturn::SUCCESS);
}
// Now we can begin checking valid proxy method calls
REQUIRE(eventGenerator.Create() == GW::GReturn::SUCCESS);
SECTION("Testing Valid proxy method calls")
{
REQUIRE(+eventGenerator.Observers(listenerCount));
REQUIRE(+eventGenerator.Push(GW::GEvent()));
CHECK(+eventGenerator.Register(emptyInterface, nullptr));
REQUIRE(+emptyInterface.Create());
}
}
So far I've been pretty successful on writing new unit tests, the biggest thing here is that debugging through the unit tests gives me more understanding of the new event system. Which I will have to tell Chris about so he can document on it.
So far I've been pretty successful on writing new unit tests, the biggest thing here is that debugging through the unit tests gives me more understanding of the new event system. Which I will have to tell Chris about so he can document on it.
No comments:
Post a Comment