mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerservercore.h
changeset 0 f0cf47e981f9
child 32 73a1feb507fb
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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:  Unit tests for CMusManagerServerCore class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef UT_CMUSMANAGERSERVERCORE_H
       
    20 #define UT_CMUSMANAGERSERVERCORE_H
       
    21 
       
    22 #include "musmanagerservercoreobserver.h"
       
    23 #include "musMonitorAvailabilityObserver.h"
       
    24 #include <digia/eunit/ceunittestsuiteclass.h>
       
    25 
       
    26 class CMusManagerServerCore;
       
    27 
       
    28 #include <e32def.h>
       
    29 #ifndef NONSHARABLE_CLASS
       
    30     #define NONSHARABLE_CLASS(x) class x
       
    31 #endif
       
    32 
       
    33 /**
       
    34  *  Unit test class for CMusManagerServerCore.
       
    35  *  Implements unit tests for CMusManagerServerCore.
       
    36  *
       
    37  *  @since S60 v3.2
       
    38  */
       
    39 NONSHARABLE_CLASS( UT_CMusManagerServerCore ) : public CEUnitTestSuiteClass,
       
    40     MMusMonitorAvailabilityObserver,
       
    41     MMusManagerServerCoreObserver
       
    42     {
       
    43 public:
       
    44 
       
    45     static UT_CMusManagerServerCore* NewL();
       
    46 
       
    47     static UT_CMusManagerServerCore* NewLC();
       
    48 
       
    49     /**
       
    50      * Destructor.
       
    51      */
       
    52     ~UT_CMusManagerServerCore();
       
    53 
       
    54 // from baseclass MMusManagerServerCoreObserver.
       
    55 
       
    56     /**
       
    57      * From MMusManagerServerCoreObserver.
       
    58      * Stops server.
       
    59      *
       
    60      * @since S60 v3.2
       
    61      */
       
    62     virtual void StopServer();
       
    63 
       
    64     
       
    65     virtual TUint SessionCount();
       
    66 
       
    67 // from baseclass MMusMonitorAvailabilityObserver.
       
    68 
       
    69     /**
       
    70      * From MMusMonitorAvailabilityObserver.
       
    71      * Informs of a change in multimediasharing availability.
       
    72      *
       
    73      * @since S60 v3.2
       
    74      * @param aStatus New state of availability.
       
    75      */
       
    76     virtual void AvailabilityChangedL( MultimediaSharing::TMusAvailabilityStatus aStatus );
       
    77     
       
    78     virtual void RequestComplete();
       
    79     					
       
    80 private:
       
    81 
       
    82     UT_CMusManagerServerCore();
       
    83 
       
    84     void ConstructL();
       
    85 
       
    86     /**
       
    87     * Sets up a test case.
       
    88     */
       
    89     void SetupL();
       
    90 
       
    91     /**
       
    92     * Tears down a test case.
       
    93     */
       
    94     void Teardown();
       
    95 
       
    96     /**
       
    97     * Invidual unit test methods.
       
    98     */
       
    99     void UT_CMusManagerServerCore_NewLL();
       
   100     void UT_CMusManagerServerCore_NewLCL();
       
   101     void UT_CMusManagerServerCore_AvailabilityQueryLL();
       
   102     void UT_CMusManagerServerCore_InvestigateAvailabilityLL();
       
   103     void UT_CMusManagerServerCore_InvitationReceivedLL();
       
   104     void UT_CMusManagerServerCore_OptionsReceivedLL();
       
   105     void UT_CMusManagerServerCore_StartMultimediaSharingLL();
       
   106     void UT_CMusManagerServerCore_StopMultimediaSharingLL();
       
   107     void UT_CMusManagerServerCore_EventNoSessionsL();
       
   108     void UT_CMusManagerServerCore_PluginStoppedL();
       
   109     void UT_CMusManagerServerCore_AvailabilityChangedLL();
       
   110     void UT_CMusManagerServerCore_MonitorAvailabilityLL();
       
   111     void UT_CMusManagerServerCore_RegisterObserverL();
       
   112 
       
   113 
       
   114 private: // data
       
   115 
       
   116     /**
       
   117      * Tested class.
       
   118      * Own.
       
   119      */
       
   120     CMusManagerServerCore* iCore;
       
   121 
       
   122     /**
       
   123      * Tells if observer function is called.
       
   124      */
       
   125     TBool iStopServerCalled;
       
   126 
       
   127     /**
       
   128      * Tells if observer function is called.
       
   129      */
       
   130     TBool iAvailabilityChangedLCalled;
       
   131 
       
   132     /**
       
   133      * Stub count of sessions for MMusManagerServerCoreObserver::SessionCount.
       
   134      */
       
   135     TUint iSessionCount;
       
   136 
       
   137     EUNIT_DECLARE_TEST_TABLE;
       
   138     };
       
   139 
       
   140 #endif // UT_CMUSMANAGERSERVERCORE_H