Test Your ENI Operations¶
Test From EniBase
Interface¶
Your ENI operations will only be accessed from the two public member functions
of eni::EniBase
.
Gas getGas()
should return the gas cost of your ENI operation.char* start()
should run your ENI operation and return the results in JSON format.
You may test your subclass through these two public functions.
eni::EniBase* functor = new Reverse("[\"Hello World\"]");
ASSERT_NE(functor, nullptr);
EXPECT_EQ(functor->getGas(), 12);
char* ret = functor->start();
EXPECT_EQ(::strcmp(ret, "[\"!dlroW olleH\"]"), 0);
free(ret);
delete functor;