uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginerequest.cpp
changeset 15 81eeb8c83ce5
parent 0 5e5d6b214f4f
equal deleted inserted replaced
0:5e5d6b214f4f 15:81eeb8c83ce5
     1 /*
       
     2 * t_vimpstenginerequest.cpp :: 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:t_vimpstenginerequest.cpp
       
    15 *
       
    16 */
       
    17 #include <EUnitMacros.h>
       
    18 #include <TEUnitAssertionInfo.h>
       
    19 #include <CEUnitAllocTestCaseDecorator.h>
       
    20 #include "t_vimpstenginerequest.h"
       
    21 #include "cvimpstenginerequest.h"
       
    22 
       
    23 
       
    24 TXIMPRequestId gTXIMPRequestId;
       
    25 
       
    26 T_VIMPSTEngineRequest* T_VIMPSTEngineRequest::NewLC()
       
    27     {
       
    28     T_VIMPSTEngineRequest* self = new( ELeave ) T_VIMPSTEngineRequest;
       
    29     CleanupStack::PushL( self );
       
    30     self->ConstructL();
       
    31     return self;
       
    32     }
       
    33 
       
    34 T_VIMPSTEngineRequest::~T_VIMPSTEngineRequest()
       
    35     {
       
    36     }
       
    37 
       
    38 void T_VIMPSTEngineRequest::ConstructL()
       
    39     {
       
    40     CEUnitTestSuiteClass::ConstructL();
       
    41     }
       
    42 
       
    43         
       
    44 void T_VIMPSTEngineRequest::SetupL()
       
    45     {
       
    46     gTXIMPRequestId.Init(100);   
       
    47     iRequest = CVIMPSTEngineRequest::NewL(gTXIMPRequestId,
       
    48         					EVIMPSTXimpOperationBind) ;
       
    49     }    
       
    50 
       
    51 void T_VIMPSTEngineRequest::Teardown()
       
    52     {
       
    53     delete iRequest;
       
    54     }
       
    55 
       
    56 
       
    57 void T_VIMPSTEngineRequest::TestAllFunctionsL()
       
    58     {
       
    59     
       
    60     //Do all the functions here..   
       
    61     EUNIT_ASSERT( EVIMPSTXimpOperationBind == iRequest->RequestType() );
       
    62     
       
    63     EUNIT_ASSERT( gTXIMPRequestId == iRequest->GetRequestId() );
       
    64     
       
    65     
       
    66     iRequest->SetRequestType(EVIMPSTXimpOperationUnBind);
       
    67     EUNIT_ASSERT( EVIMPSTXimpOperationUnBind == iRequest->RequestType() );
       
    68     
       
    69        
       
    70     iRequest->StopWait();
       
    71     TBool temp = iRequest->IsWaitStarted();
       
    72     EUNIT_ASSERT( EFalse == temp );
       
    73     iRequest->StopWait();
       
    74     
       
    75     iRequest->StartWait();
       
    76      temp = iRequest->IsWaitStarted();
       
    77     EUNIT_ASSERT( EFalse == temp );
       
    78 
       
    79       
       
    80     
       
    81     }
       
    82 
       
    83 
       
    84 EUNIT_BEGIN_TEST_TABLE( T_VIMPSTEngineRequest, "T_VIMPSTEngineRequest", "" )
       
    85 
       
    86     EUNIT_TEST( "", "", "", "", SetupL, TestAllFunctionsL, Teardown )
       
    87     
       
    88 EUNIT_END_TESTCASE_TABLE
       
    89 
       
    90 //  END OF FILE