Vodafone Test Suite

Dependencies:   mbed-rtos mbed HTTPClient VodafoneUSBModem

VodafoneTestCase.h

Committer:
nherriot
Date:
2012-09-14
Revision:
54:30062a67e8bb
Parent:
36:dd730ff4962e

File content as of revision 54:30062a67e8bb:

#pragma once
#include "VodafoneUSBModem.h"
#include "LogHeader.h"

const char myMessage[] = "myMessage is golden";

//const char testPhoneNumber[] = "+447717275049"; // this is my number - change to this to get all the 'send' tests to send to my number
const char gTestPhoneNumber[] = "+447785666088";   // this is my test contract sim - change to this to get all the 'send' tests to send to it's self - making tests automatic! :-)
const char gTestMessage[] = "this is a test message !";
const char gAlphabetNumbersMessage[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char gAallCharsMessage[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()!£$%&*,.':;";
const char gIrregularMessage[] = "/:[]{}()!£$%&*,.';";


class VodafoneTestCase {
   public:
      VodafoneTestCase(VodafoneUSBModem *m) : _modem(m) , _lastRunTime(0), _lastRunOutcome(false) {
      }
      
      bool run() {
         _lastRunTime = time(NULL);
         setupTest();
         _lastRunOutcome = execute();
         endTest();
         return _lastRunOutcome;  
      }
      
      virtual void setupTest() {
      }
      
      virtual bool execute() {
         LOG("Base class runTest called!");
         return true;
      }
      
      virtual void endTest() {
         
      }
      
   protected:
      VodafoneUSBModem *_modem;
      
   public:
      time_t _lastRunTime;
      bool _lastRunOutcome;
      int _testCaseNumber;
      const char* _description;
};