mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitorbase.h
changeset 22 496ad160a278
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __UT_CMusCallMonitorBase_H__
       
    20 #define __UT_CMusCallMonitorBase_H__
       
    21 
       
    22 
       
    23 //  EXTERNAL INCLUDES
       
    24 #include <digia/eunit/ceunittestsuiteclass.h>
       
    25 #include <digia/eunit/eunitmacros.h>
       
    26 #include "etelmm.h"
       
    27 #include "muscallmonitorbase.h"
       
    28 #include "mussesseioninformationapi.h"
       
    29 #include "mmustsypropertyobserver.h"
       
    30 #include "mmuscallstateobserver.h"
       
    31 
       
    32 
       
    33 // Forward declaration
       
    34 
       
    35 // Next row is to disable warning emerging from EUnit code.
       
    36 // Placement is due to a fact that most test case files
       
    37 // include this file. Directive can be removed when 
       
    38 // EUnit is fixed.  
       
    39 #pragma warn_illtokenpasting off
       
    40 
       
    41 class CMusCallMonitorMock : public CMusCallMonitorBase
       
    42 							
       
    43     {
       
    44 public:
       
    45     
       
    46     CMusCallMonitorMock( const RMobileCall& aCall,
       
    47     					MMusTsyPropertyObserver& aObserver,
       
    48     					MMusCallStateObserver& aCallStateObserver );
       
    49     ~CMusCallMonitorMock();
       
    50     
       
    51     private:
       
    52 
       
    53     void RunL();
       
    54     void DoCancel();
       
    55     };
       
    56 
       
    57 
       
    58 
       
    59 //  CLASS DEFINITION
       
    60 /**
       
    61  * Tester class for CMusCallMonitorBase. 
       
    62  * 
       
    63  */
       
    64 NONSHARABLE_CLASS( UT_CMusCallMonitorBase ): public CEUnitTestSuiteClass,
       
    65 											MMusTsyPropertyObserver,
       
    66 											MMusCallStateObserver
       
    67     {
       
    68     public:
       
    69         //Two phase construction
       
    70         static UT_CMusCallMonitorBase* NewL();
       
    71         static UT_CMusCallMonitorBase* NewLC();
       
    72         // Destructor                  
       
    73         ~UT_CMusCallMonitorBase();
       
    74         
       
    75     public:    // from MMusTsyPropertyObserver.
       
    76     
       
    77     /**
       
    78      * Notify call state changed
       
    79      * @param aVal The call status
       
    80      * @param aCallName The name of the call
       
    81      */
       
    82     virtual void NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal,
       
    83     									 TName& aCallName );
       
    84     
       
    85     public:    // from MMusCallStateObserver.
       
    86     virtual void MusCallStateChanged();
       
    87     
       
    88 
       
    89     private: // Constructor
       
    90         UT_CMusCallMonitorBase();
       
    91         void ConstructL();
       
    92 
       
    93     private: // Test case setup and teardown
       
    94         void SetupL();
       
    95         void Setup2L();
       
    96         
       
    97         void Teardown();
       
    98 
       
    99     private: // Test methdods
       
   100         void UT_SetStateLL();
       
   101         void UT_SetCallInfoLL();
       
   102         void UT_RunErrorL();     
       
   103         void UT_CMusCallMonitorBase_IsDataReadyLL();
       
   104         
       
   105     
       
   106     private:    // Data        
       
   107         CMusCallMonitorBase* iCallMonitorBase;
       
   108         RMobileCall iCall;
       
   109         TBool iCallStateObserverInvoked;
       
   110 
       
   111         EUNIT_DECLARE_TEST_TABLE;
       
   112 
       
   113     };
       
   114 
       
   115 #endif      //  __UT_CMusCallMonitorBase_H__
       
   116 
       
   117 // End of file