MSEventControlTest.cpp

Go to the documentation of this file.
00001 #include <gtest/gtest.h>
00002 #include <microsim/MSEventControl.h>
00003 #include "../utils/common/CommandMock.h"
00004 
00005 using namespace std;
00006 
00007 /*
00008 Tests the class MSEventControl 
00009 */
00010 
00011 /* Test the method 'execute'. Tests if the execute method from the Command Class is called.*/
00012 
00013 TEST(MSEventControl, test_method_execute) { 
00014     
00015     MSEventControl *edge = new MSEventControl();
00016     CommandMock *mock = new CommandMock(); 
00017     edge->setCurrentTimeStep(4);
00018     edge->addEvent(mock,1,MSEventControl::ADAPT_AFTER_EXECUTION);
00019     
00020     EXPECT_FALSE(mock->isExecuteCalled());
00021     edge->execute(5);
00022     EXPECT_TRUE(mock->isExecuteCalled());
00023 }
00024 
00025 
00026 

Generated on Wed May 5 00:06:31 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6