email/imap4mtm/imapsession/test/src/ctestimapbodystructurebuilder.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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 #include "ctestimapbodystructurebuilder.h"
       
    17 
       
    18 #include <utf.h>
       
    19 
       
    20 #include "cimapatom.h"
       
    21 #include "cimapatomparser.h"
       
    22 #include "cimapatomwalker.h"
       
    23 #include "cimapbodystructurebuilder.h"
       
    24 #include "cimapbodystructure.h"
       
    25 #include "cimapfetchresponse.h"
       
    26 #include "cimaplogger.h"
       
    27 
       
    28 CTestImapBodyStructureBuilder::CTestImapBodyStructureBuilder()
       
    29 	: iFetchResponse(NULL)
       
    30 	, iBodyStructureBuilder(NULL)
       
    31 	{}
       
    32 
       
    33 CTestImapBodyStructureBuilder::~CTestImapBodyStructureBuilder()
       
    34 	{
       
    35 	delete iBodyStructureBuilder;
       
    36 	delete iFetchResponse;
       
    37 	}
       
    38 
       
    39 void CTestImapBodyStructureBuilder::SetupL()
       
    40 	{
       
    41 	iFetchResponse = CImapFetchResponse::NewL();
       
    42 	iBodyStructureBuilder = CImapBodyStructureBuilder::NewL(*iFetchResponse, KDefaultLog);
       
    43 	}
       
    44 	
       
    45 void CTestImapBodyStructureBuilder::TearDownL()
       
    46 	{
       
    47 	delete iBodyStructureBuilder;
       
    48 	iBodyStructureBuilder = NULL;
       
    49 	
       
    50 	delete iFetchResponse;
       
    51 	iFetchResponse = NULL;
       
    52 	}
       
    53 
       
    54 void CTestImapBodyStructureBuilder::AssertDescriptorsEqual(const TDesC8& aFirst, const TDesC8& aSecond)
       
    55 	{
       
    56 	ASSERT_EQUALS(aFirst, aSecond);
       
    57 	}
       
    58 
       
    59 void CTestImapBodyStructureBuilder::TestSimpleTextMessageL()
       
    60 	{
       
    61 	INFO_PRINTF1(_L("TestSimpleTextMessageL"));
       
    62 	
       
    63 	_LIT8(KLine, "(TEXT PLAIN (name1 value1 name2 value2) ID \"this is a description\" encoding size lines");
       
    64 	//_LIT8(KLine, "(TEXT PLAIN NIL ID \"this is a description\" encoding size lines)");
       
    65 	//_LIT8(KLine, "(TEXT PLAIN NIL \"NIL\" NIL 123 5)");
       
    66 
       
    67 	TBool wantMore = iBodyStructureBuilder->ProcessBlockL(KLine);
       
    68 	ASSERT_FALSE(wantMore);
       
    69 
       
    70 	CImapBodyStructure* bodyStructure = iFetchResponse->BodyStructure();
       
    71 	ASSERT_NOT_NULL(bodyStructure);
       
    72 	AssertDescriptorsEqual(bodyStructure->Type(), _L8("TEXT"));
       
    73 	AssertDescriptorsEqual(bodyStructure->SubType(), _L8("PLAIN"));
       
    74 	AssertDescriptorsEqual(bodyStructure->BodyDescription(), _L8("this is a description"));
       
    75 
       
    76 	// To Improve Coverage
       
    77 	bodyStructure->ExtMD5();
       
    78 	const TBufC8<1> yy;
       
    79 	TRAP_IGNORE(bodyStructure->AppendExtLanguageListL(yy));
       
    80 	bodyStructure->SetExtLocation(yy);
       
    81 	
       
    82 	}
       
    83 
       
    84 void CTestImapBodyStructureBuilder::TestComplexTextMessageL()
       
    85 	{
       
    86 	INFO_PRINTF1(_L("TestComplexTextMessageL"));
       
    87 	
       
    88 	_LIT8(KLine1, "(TEXT PLAIN (name1 value1 name2 value2 name3 value3) ID {25}");
       
    89 	_LIT8(KLit2, "first line\r\nsecond line\r\n");
       
    90 	_LIT8(KLine3, "encoding size lines MD5 (disp (dn1 dv1 dn2 dv2)) lang place (ext1 ext2 (ext3 ext4) ext5)");
       
    91 //	_LIT8(KLine3, "encoding size lines");
       
    92 //	_LIT8(KLine3, "encoding size \"missing quote"); // and missing end bracket!
       
    93 //	_LIT8(KLine3, "encoding size lines) Stuff at the end that we're not interested in");
       
    94 	
       
    95 	TBool wantMore = iBodyStructureBuilder->ProcessBlockL(KLine1);
       
    96 	ASSERT_TRUE(wantMore);
       
    97 	wantMore = iBodyStructureBuilder->ProcessBlockL(KLit2);
       
    98 	ASSERT_TRUE(wantMore);
       
    99 	wantMore = iBodyStructureBuilder->ProcessBlockL(KLine3);
       
   100 	ASSERT_FALSE(wantMore);
       
   101 	
       
   102 	CImapBodyStructure* bodyStructure = iFetchResponse->BodyStructure();
       
   103 	ASSERT_NOT_NULL(bodyStructure);
       
   104 	AssertDescriptorsEqual(bodyStructure->Type(), _L8("TEXT"));
       
   105 	AssertDescriptorsEqual(bodyStructure->SubType(), _L8("PLAIN"));
       
   106 	ASSERT_EQUALS(bodyStructure->ParameterList().Count(), 3);
       
   107  	ASSERT_EQUALS(bodyStructure->ParameterList()[0].iAttribute, _L8("name1"));
       
   108 	ASSERT_EQUALS(bodyStructure->ParameterList()[0].iValue, _L8("value1"));
       
   109 	ASSERT_EQUALS(bodyStructure->ParameterList()[1].iAttribute, _L8("name2"));
       
   110 	ASSERT_EQUALS(bodyStructure->ParameterList()[1].iValue, _L8("value2"));
       
   111 	ASSERT_EQUALS(bodyStructure->ParameterList()[2].iAttribute, _L8("name3"));
       
   112 	ASSERT_EQUALS(bodyStructure->ParameterList()[2].iValue, _L8("value3"));
       
   113 	AssertDescriptorsEqual(bodyStructure->BodyId(), _L8("ID"));
       
   114 	AssertDescriptorsEqual(bodyStructure->BodyDescription(), _L8("first line\r\nsecond line\r\n"));
       
   115 	
       
   116 	// extensions
       
   117 	AssertDescriptorsEqual(bodyStructure->ExtDispositionName(), _L8("disp"));
       
   118 	ASSERT_EQUALS(bodyStructure->ExtDispositionParameterList().Count(), 2);
       
   119 	ASSERT_EQUALS(bodyStructure->ExtDispositionParameterList()[0].iAttribute, _L8("dn1"));
       
   120 	ASSERT_EQUALS(bodyStructure->ExtDispositionParameterList()[0].iValue, _L8("dv1"));
       
   121 	ASSERT_EQUALS(bodyStructure->ExtDispositionParameterList()[1].iAttribute, _L8("dn2"));
       
   122 	ASSERT_EQUALS(bodyStructure->ExtDispositionParameterList()[1].iValue, _L8("dv2"));
       
   123 	ASSERT_EQUALS(bodyStructure->ExtLanguageList().Count(), 1);
       
   124 	ASSERT_EQUALS(bodyStructure->ExtLanguageList()[0], _L8("lang"));
       
   125 	AssertDescriptorsEqual(bodyStructure->ExtLocation(), _L8("place"));	
       
   126 	}
       
   127 
       
   128 void CTestImapBodyStructureBuilder::TestRfc822MessageL()
       
   129 	{
       
   130 	INFO_PRINTF1(_L("TestRfc822MessageL"));
       
   131 		
       
   132 	_LIT8(KLine, "(\"MESSAGE\" \"RFC822\" (n1 v1 n2 v2) rfcID \"this is an rfc822 message\" rfcEncoding rfcSize (env-date env-subject ((from1name from1adl from1mbox from1host)(NIL NIL from2mbox from2host)) NIL NIL ((to-name to-adl to-mbox to-host)) NIL NIL in-reply-to msg-id) (TEXT PLAIN NIL subID \"sub description\" subEncoding subSize subLines) rfcLines");
       
   133 	
       
   134 	TBool wantMore = iBodyStructureBuilder->ProcessBlockL(KLine);
       
   135 	ASSERT_FALSE(wantMore);
       
   136 
       
   137 	// Check the root bodystructure
       
   138 	CImapBodyStructure* bodyStructure = iFetchResponse->BodyStructure();
       
   139 	ASSERT_NOT_NULL(bodyStructure);
       
   140 	AssertDescriptorsEqual(bodyStructure->Type(), _L8("MESSAGE"));
       
   141 	AssertDescriptorsEqual(bodyStructure->SubType(), _L8("RFC822"));
       
   142 	AssertDescriptorsEqual(bodyStructure->BodyDescription(), _L8("this is an rfc822 message"));
       
   143 	AssertDescriptorsEqual(bodyStructure->BodyLines(), _L8("rfcLines"));
       
   144 	AssertDescriptorsEqual(bodyStructure->BodyId(), _L8("rfcID"));
       
   145 	AssertDescriptorsEqual(bodyStructure->BodyEncoding(), _L8("rfcEncoding"));
       
   146 	AssertDescriptorsEqual(bodyStructure->BodySizeOctets(), _L8("rfcSize"));
       
   147 	ASSERT_EQUALS(bodyStructure->ParameterList().Count(), 2);
       
   148  	ASSERT_EQUALS(bodyStructure->ParameterList()[0].iAttribute, _L8("n1"));
       
   149 	ASSERT_EQUALS(bodyStructure->ParameterList()[0].iValue, _L8("v1"));
       
   150 	ASSERT_EQUALS(bodyStructure->ParameterList()[1].iAttribute, _L8("n2"));
       
   151 	ASSERT_EQUALS(bodyStructure->ParameterList()[1].iValue, _L8("v2"));
       
   152 	
       
   153 	// Check its envelope
       
   154 	CImapEnvelope& envelope = bodyStructure->GetRfc822EnvelopeStructureL();
       
   155 	AssertDescriptorsEqual(envelope.EnvDate(), _L8("env-date"));
       
   156 	AssertDescriptorsEqual(envelope.EnvSubject(), _L8("env-subject"));
       
   157 	ASSERT_EQUALS(envelope.EnvFrom().Count(), 2);
       
   158 	CheckAddressL(envelope.EnvFrom()[0], _L16("\"from1name\" <from1mbox@from1host>"));
       
   159 	CheckAddressL(envelope.EnvFrom()[1], _L16("from2mbox@from2host"));
       
   160 	ASSERT_EQUALS(envelope.EnvSender().Count(), 0);
       
   161 	ASSERT_EQUALS(envelope.EnvReplyTo().Count(), 0);
       
   162 	ASSERT_EQUALS(envelope.EnvTo().Count(), 1);
       
   163 	CheckAddressL(envelope.EnvTo()[0], _L16("\"to-name\" <to-mbox@to-host>"));
       
   164 	ASSERT_EQUALS(envelope.EnvCc().Count(), 0);
       
   165 	ASSERT_EQUALS(envelope.EnvBcc().Count(), 0);	
       
   166 	AssertDescriptorsEqual(envelope.EnvInReplyTo(), _L8("in-reply-to"));
       
   167 	AssertDescriptorsEqual(envelope.EnvMessageId(), _L8("msg-id"));
       
   168 	
       
   169 	// Check the embedded bodystructure
       
   170 	ASSERT_EQUALS(bodyStructure->EmbeddedBodyStructureList().Count(), 1);
       
   171 	CImapBodyStructure* bodyStructureEmbedded = bodyStructure->EmbeddedBodyStructureList()[0];
       
   172 	
       
   173 	AssertDescriptorsEqual(bodyStructureEmbedded->Type(), _L8("TEXT"));
       
   174 	AssertDescriptorsEqual(bodyStructureEmbedded->SubType(), _L8("PLAIN"));
       
   175 	ASSERT_EQUALS(bodyStructureEmbedded->ParameterList().Count(), 0);
       
   176  	AssertDescriptorsEqual(bodyStructureEmbedded->BodyId(), _L8("subID"));
       
   177 	AssertDescriptorsEqual(bodyStructureEmbedded->BodyDescription(), _L8("sub description"));
       
   178 	AssertDescriptorsEqual(bodyStructureEmbedded->BodyEncoding(), _L8("subEncoding"));
       
   179 	AssertDescriptorsEqual(bodyStructureEmbedded->BodySizeOctets(), _L8("subSize"));
       
   180 	AssertDescriptorsEqual(bodyStructureEmbedded->BodyLines(), _L8("subLines"));
       
   181 	}
       
   182 	
       
   183 void CTestImapBodyStructureBuilder::CheckAddressL(const CImapEnvelope::TAddress& aAddress, const TDesC16& aExpectedAddressString)
       
   184 	{
       
   185 	HBufC16* addressString = aAddress.CreateAddressStringL();
       
   186 	CleanupStack::PushL(addressString);
       
   187 	
       
   188 	ASSERT_EQUALS((TDesC16&)*addressString, aExpectedAddressString);
       
   189 	
       
   190 	CleanupStack::PopAndDestroy(addressString);
       
   191 	}
       
   192 
       
   193 void CTestImapBodyStructureBuilder::TestMultipartTextMessageNestLeftL()
       
   194 	{
       
   195 	INFO_PRINTF1(_L("TestMultipartTextMessageNestLeftL"));
       
   196 	
       
   197 //	_LIT8(KLine, "((\"TEXT\" \"PLAIN\" (n1 v1 n2 v2) ID description encoding size lines)(\"TEXT\" \"PLAIN\" (xn1 xv1 xn2 xv2) xID xDescription xEncoding xSize xLines) \"MIXED\")");
       
   198 	_LIT8(KLine, "(((\"TEXT\" \"PLAIN\" (An1 Av1 An2 Av2) aID Adescription Aencoding Asize Alines)(\"TEXT\" \"PLAIN\" (Bn1 Bv1 Bn2 Bv2) bID Bdescription Bencoding Bsize Blines) \"gMIXED\" (gn1 gv1) (gdisp (gdn1 gdv1)) NIL gLondon (gExt1 gExt2 (gExt3 gExt4)))(\"TEXT\" \"PLAIN\" (xn1 xv1 xn2 xv2) xID xDescription xEncoding xSize xLines) \"hMIXED\")");
       
   199 	
       
   200 	// (((a)(b) gM gE)(x) hM)
       
   201 	
       
   202 	TBool wantMore = iBodyStructureBuilder->ProcessBlockL(KLine);
       
   203 	ASSERT_FALSE(wantMore);
       
   204 	
       
   205 	// Root
       
   206 	CImapBodyStructure* bodyStructurePart_h = iFetchResponse->BodyStructure();
       
   207 	ASSERT_NOT_NULL(bodyStructurePart_h);
       
   208 	AssertDescriptorsEqual(bodyStructurePart_h->Type(), _L8("MULTIPART")); // << possibly leave this blank, and use iBodyStructureType enum instead.
       
   209 	AssertDescriptorsEqual(bodyStructurePart_h->SubType(), _L8("hMIXED"));
       
   210 	
       
   211 	ASSERT_EQUALS(bodyStructurePart_h->EmbeddedBodyStructureList().Count(), 2);
       
   212 	
       
   213 	
       
   214 	// MULTI on the left
       
   215 	CImapBodyStructure* bodyStructurePart_h_g = bodyStructurePart_h->EmbeddedBodyStructureList()[0];
       
   216 	
       
   217 	AssertDescriptorsEqual(bodyStructurePart_h_g->Type(), _L8("MULTIPART")); // << possibly leave this blank, and use iBodyStructureType enum instead.
       
   218 	AssertDescriptorsEqual(bodyStructurePart_h_g->SubType(), _L8("gMIXED"));
       
   219 	
       
   220 	// extensions
       
   221 	ASSERT_EQUALS(bodyStructurePart_h_g->ParameterList().Count(), 1);
       
   222 	ASSERT_EQUALS(bodyStructurePart_h_g->ParameterList()[0].iAttribute, _L8("gn1"));
       
   223 	ASSERT_EQUALS(bodyStructurePart_h_g->ParameterList()[0].iValue, _L8("gv1"));
       
   224 	AssertDescriptorsEqual(bodyStructurePart_h_g->ExtDispositionName(), _L8("gdisp"));
       
   225 	ASSERT_EQUALS(bodyStructurePart_h_g->ExtDispositionParameterList().Count(), 1);
       
   226 	ASSERT_EQUALS(bodyStructurePart_h_g->ExtDispositionParameterList()[0].iAttribute, _L8("gdn1"));
       
   227 	ASSERT_EQUALS(bodyStructurePart_h_g->ExtDispositionParameterList()[0].iValue, _L8("gdv1"));
       
   228 	ASSERT_EQUALS(bodyStructurePart_h_g->ExtLanguageList().Count(), 0);
       
   229 	AssertDescriptorsEqual(bodyStructurePart_h_g->ExtLocation(), _L8("gLondon"));
       
   230 
       
   231 	
       
   232 	ASSERT_EQUALS(bodyStructurePart_h_g->EmbeddedBodyStructureList().Count(), 2);
       
   233 	CImapBodyStructure* bodyStructurePart_h_g_a = bodyStructurePart_h_g->EmbeddedBodyStructureList()[0];
       
   234 	CImapBodyStructure* bodyStructurePart_h_g_b = bodyStructurePart_h_g->EmbeddedBodyStructureList()[1];
       
   235 		
       
   236 	AssertDescriptorsEqual(bodyStructurePart_h_g_a->Type(), _L8("TEXT"));
       
   237 	AssertDescriptorsEqual(bodyStructurePart_h_g_a->SubType(), _L8("PLAIN"));
       
   238 	AssertDescriptorsEqual(bodyStructurePart_h_g_a->BodyDescription(), _L8("Adescription"));
       
   239 	AssertDescriptorsEqual(bodyStructurePart_h_g_a->BodyLines(), _L8("Alines"));
       
   240 	
       
   241 	AssertDescriptorsEqual(bodyStructurePart_h_g_b->Type(), _L8("TEXT"));
       
   242 	AssertDescriptorsEqual(bodyStructurePart_h_g_b->SubType(), _L8("PLAIN"));
       
   243 	AssertDescriptorsEqual(bodyStructurePart_h_g_b->BodyDescription(), _L8("Bdescription"));
       
   244 	AssertDescriptorsEqual(bodyStructurePart_h_g_b->BodyLines(), _L8("Blines"));
       
   245 	
       
   246 	
       
   247 	// PLAIN TEXT on the right
       
   248 	CImapBodyStructure* bodyStructurePart_h_x  = bodyStructurePart_h->EmbeddedBodyStructureList()[1];
       
   249 	
       
   250 	AssertDescriptorsEqual(bodyStructurePart_h_x->Type(), _L8("TEXT"));
       
   251 	AssertDescriptorsEqual(bodyStructurePart_h_x->SubType(), _L8("PLAIN"));
       
   252 	AssertDescriptorsEqual(bodyStructurePart_h_x->BodyDescription(), _L8("xDescription"));
       
   253 	AssertDescriptorsEqual(bodyStructurePart_h_x->BodyLines(), _L8("xLines"));
       
   254 	}
       
   255 	
       
   256 void CTestImapBodyStructureBuilder::TestMultipartTextMessageNestRightL()
       
   257 	{
       
   258 	INFO_PRINTF1(_L("TestMultipartTextMessageNestRightL"));
       
   259 	
       
   260 //	_LIT8(KLine, "((\"TEXT\" \"PLAIN\" (n1 v1 n2 v2) ID description encoding size lines)(\"TEXT\" \"PLAIN\" (xn1 xv1 xn2 xv2) xID xDescription xEncoding xSize xLines) \"MIXED\")");
       
   261 	_LIT8(KLine, "((\"TEXT\" \"PLAIN\" (An1 Av1 An2 Av2) aID Adescription Aencoding Asize Alines)((\"TEXT\" \"PLAIN\" (Bn1 Bv1 Bn2 Bv2) bID Bdescription Bencoding Bsize Blines)(\"TEXT\" \"PLAIN\" (xn1 xv1 xn2 xv2) xID xDescription xEncoding xSize xLines) \"gMIXED\") \"hMIXED\" (hn1 hv1) (hdisp (hdn1 hdv1)) (hENG hESP) NIL (hExt1 hExt2 (hExt3 hExt4)))");
       
   262 	
       
   263 	// ((a)((b)(x) gM) hM hE)
       
   264 	
       
   265 	TBool wantMore = iBodyStructureBuilder->ProcessBlockL(KLine);
       
   266 	ASSERT_FALSE(wantMore);
       
   267 	
       
   268 	// Root
       
   269 	CImapBodyStructure* bodyStructurePart_h = iFetchResponse->BodyStructure();
       
   270 	ASSERT_NOT_NULL(bodyStructurePart_h);
       
   271 	AssertDescriptorsEqual(bodyStructurePart_h->Type(), _L8("MULTIPART")); // << possibly leave this blank, and use iBodyStructureType enum instead.
       
   272 	AssertDescriptorsEqual(bodyStructurePart_h->SubType(), _L8("hMIXED"));
       
   273 	
       
   274 	ASSERT_EQUALS(bodyStructurePart_h->EmbeddedBodyStructureList().Count(), 2);
       
   275 
       
   276 	// extensions
       
   277 	ASSERT_EQUALS(bodyStructurePart_h->ParameterList().Count(), 1);
       
   278 	ASSERT_EQUALS(bodyStructurePart_h->ParameterList()[0].iAttribute, _L8("hn1"));
       
   279 	ASSERT_EQUALS(bodyStructurePart_h->ParameterList()[0].iValue, _L8("hv1"));
       
   280 	AssertDescriptorsEqual(bodyStructurePart_h->ExtDispositionName(), _L8("hdisp"));
       
   281 	ASSERT_EQUALS(bodyStructurePart_h->ExtDispositionParameterList().Count(), 1);
       
   282 	ASSERT_EQUALS(bodyStructurePart_h->ExtDispositionParameterList()[0].iAttribute, _L8("hdn1"));
       
   283 	ASSERT_EQUALS(bodyStructurePart_h->ExtDispositionParameterList()[0].iValue, _L8("hdv1"));
       
   284 	ASSERT_EQUALS(bodyStructurePart_h->ExtLanguageList().Count(), 2);
       
   285 	ASSERT_EQUALS(bodyStructurePart_h->ExtLanguageList()[0], _L8("hENG"));
       
   286 	ASSERT_EQUALS(bodyStructurePart_h->ExtLanguageList()[1], _L8("hESP"));
       
   287 	AssertDescriptorsEqual(bodyStructurePart_h->ExtLocation(), _L8(""));
       
   288 	
       
   289 	// PLAIN TEXT on the left
       
   290 	CImapBodyStructure* bodyStructurePart_h_a  = bodyStructurePart_h->EmbeddedBodyStructureList()[0];
       
   291 	
       
   292 	AssertDescriptorsEqual(bodyStructurePart_h_a->Type(), _L8("TEXT"));
       
   293 	AssertDescriptorsEqual(bodyStructurePart_h_a->SubType(), _L8("PLAIN"));
       
   294 	AssertDescriptorsEqual(bodyStructurePart_h_a->BodyDescription(), _L8("Adescription"));
       
   295 	AssertDescriptorsEqual(bodyStructurePart_h_a->BodyLines(), _L8("Alines"));
       
   296 	
       
   297 	// MULTI on the right
       
   298 	CImapBodyStructure* bodyStructurePart_h_g = bodyStructurePart_h->EmbeddedBodyStructureList()[1];
       
   299 	
       
   300 	AssertDescriptorsEqual(bodyStructurePart_h_g->Type(), _L8("MULTIPART")); // << possibly leave this blank, and use iBodyStructureType enum instead.
       
   301 	AssertDescriptorsEqual(bodyStructurePart_h_g->SubType(), _L8("gMIXED"));
       
   302 	
       
   303 	ASSERT_EQUALS(bodyStructurePart_h_g->EmbeddedBodyStructureList().Count(), 2);
       
   304 	CImapBodyStructure* bodyStructurePart_h_g_b = bodyStructurePart_h_g->EmbeddedBodyStructureList()[0];
       
   305 	CImapBodyStructure* bodyStructurePart_h_g_x = bodyStructurePart_h_g->EmbeddedBodyStructureList()[1];
       
   306 	
       
   307 	AssertDescriptorsEqual(bodyStructurePart_h_g_b->Type(), _L8("TEXT"));
       
   308 	AssertDescriptorsEqual(bodyStructurePart_h_g_b->SubType(), _L8("PLAIN"));
       
   309 	AssertDescriptorsEqual(bodyStructurePart_h_g_b->BodyDescription(), _L8("Bdescription"));
       
   310 	AssertDescriptorsEqual(bodyStructurePart_h_g_b->BodyLines(), _L8("Blines"));
       
   311 	
       
   312 	AssertDescriptorsEqual(bodyStructurePart_h_g_x->Type(), _L8("TEXT"));
       
   313 	AssertDescriptorsEqual(bodyStructurePart_h_g_x->SubType(), _L8("PLAIN"));
       
   314 	AssertDescriptorsEqual(bodyStructurePart_h_g_x->BodyDescription(), _L8("xDescription"));
       
   315 	AssertDescriptorsEqual(bodyStructurePart_h_g_x->BodyLines(), _L8("xLines"));
       
   316 	}
       
   317 
       
   318 CTestSuite* CTestImapBodyStructureBuilder::CreateSuiteL(const TDesC& aName)
       
   319 // static
       
   320 	{
       
   321 	SUB_SUITE;
       
   322 	ADD_TEST_STEP(TestSimpleTextMessageL);
       
   323 	ADD_TEST_STEP(TestComplexTextMessageL);
       
   324 	ADD_TEST_STEP(TestRfc822MessageL);
       
   325 	ADD_TEST_STEP(TestMultipartTextMessageNestLeftL);
       
   326 	ADD_TEST_STEP(TestMultipartTextMessageNestRightL);
       
   327 	END_SUITE;
       
   328 	}