email/imap4mtm/imapsession/test/inc/ctestimapsession.h
changeset 80 8b14b30db193
parent 0 72b543305e3a
equal deleted inserted replaced
79:2981cb3aa489 80:8b14b30db193
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef CTESTIMAPSESSION_H
       
    17 #define CTESTIMAPSESSION_H
       
    18 
       
    19 #include <test/tefunit.h>
       
    20 
       
    21 // Forward Declarations
       
    22 class CFakeInputStream;
       
    23 class CFakeOutputStream;
       
    24 class CActiveWaiter;
       
    25 class CImapSession;
       
    26 
       
    27 /**
       
    28 This test fixture tests CImapSession's ability to deliver lines and literals to CImapCommand objects.
       
    29 This is a white-box test, using the simple CImapLogout class to receive lines.
       
    30 Set a breakpoint in CImapLogout::ParseMessageL() to ensure that the expected lines are being delivered.
       
    31 @internalTechnology
       
    32 @prototype
       
    33 */
       
    34 class CTestImapSession : public CActiveTestFixture
       
    35 // Note that all test suites must begin with "CTest"
       
    36 // WARNING: Despite being a C class, CActiveTestFixture is NOT derrived from CBase
       
    37 // ... so don't expect your data members to be zero'ed
       
    38 	{
       
    39 public:
       
    40 	// Constructor & Destructor (explicitly virtual because CTestFixture is NOT derrived from CBase)
       
    41 	CTestImapSession();
       
    42 	virtual ~CTestImapSession();
       
    43 	
       
    44 	// SetUp and TearDown code (optional)
       
    45 	virtual void SetupL();
       
    46 	virtual void TearDownL();
       
    47 	
       
    48 	void SetupServerGreetingL();
       
    49 
       
    50 	// Tests
       
    51 	void TestOneLineL();
       
    52 	void TestTwoLinesSimpleL();
       
    53 	void TestTwoLinesSplitBeforeFirstCrlfL();
       
    54 	void TestTwoLinesSplitAfterFirstCrlfL();
       
    55 	void TestTwoLinesSplitOverFirstCrlfL();
       
    56 	void TestTwoLinesSplitHeavilyOverFirstCrlfL();
       
    57 	void TestTwoLinesInOneBlockL();
       
    58 	void TestSevenLinesSimpleL();
       
    59 	void TestSevenLinesIn3ChunksL();
       
    60 	void TestOneLineFragmentedL();
       
    61 	void TestOneLineHeavilyFragmentedL();
       
    62 
       
    63 	void TestLoginSequenceL();
       
    64 	void TestServerStateL();
       
    65 	
       
    66 	void TestLiteralL();
       
    67 		
       
    68 	static CTestSuite* CreateSuiteL(const TDesC& aName);
       
    69 	
       
    70 private:
       
    71 	CFakeInputStream* iInputStream;
       
    72 	CFakeOutputStream* iOutputStream;
       
    73 	CActiveWaiter* iActiveWaiter;
       
    74 	CImapSession* iImapSession;
       
    75 	};
       
    76 	
       
    77 #endif CTESTIMAPSESSION_H