public void MSOXCMAPIHTTP_S01_TC07_SimultaneousRequestWithinSameSessionContext()
{
this.CheckMapiHttpIsSupported();
MailboxResponseBodyBase responseBody;
#region Send a valid Connect request type to establish a Session Context with the server.
WebHeaderCollection connectHeaders = new WebHeaderCollection();
ConnectSuccessResponseBody connectResponse = this.ConnectToServer(out connectHeaders);
#endregion
#region Send two Execute request that includes Logon ROP to server simultaneously
uint firstResponseCode;
uint secondResponseCode;
CookieCollection firstCookies = new CookieCollection();
CookieCollection secondCookies = new CookieCollection();
foreach (Cookie cookie in AdapterHelper.SessionContextCookies)
{
Cookie c = new Cookie(cookie.Name, cookie.Value, cookie.Path, cookie.Domain);
firstCookies.Add(c);
secondCookies.Add(c);
}
MethodCaller asyncThread = new MethodCaller(
() =>
{
return this.ExecuteLogonROP(firstCookies);
});
IAsyncResult result = asyncThread.BeginInvoke(null, null);
secondResponseCode = this.ExecuteLogonROP(secondCookies);
firstResponseCode = asyncThread.EndInvoke(result);
// Add the debug information
this.Site.Log.Add(
LogEntryKind.Debug,
"Verify MS-OXCMAPIHTTP_R1228: When the client has issued simultaneous requests within a Session Context,the first X-Response header is {0} and the second X-Response header is {1}.",
firstResponseCode,
secondResponseCode);
// Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R1228
bool isVerifiedR1228 = firstResponseCode == 15 || secondResponseCode == 15;
this.Site.CaptureRequirementIfIsTrue(
isVerifiedR1228,
1228,
@"[In Responding to a Connect or Bind Request Type Request] If the server detects that the client has issued simultaneous requests within a Session Context, the server MUST fail every subsequent request with a value of 15 (""Invalid Sequence"" error) in the X-ResponseCode header.");
// If the R1228 has been verified, then server return the X-ResponseCode 15 when the request has violated the sequencing requirement of one request at a time per Session Context.
// So R151 will be verified.
this.Site.CaptureRequirement(
151,
@"[In X-ResponseCode Header Field] Invalid Sequence (15): The request has violated the sequencing requirement of one request at a time per Session Context.");
#endregion
#region Send a Disconnect request type request to destroy the Session Context.
this.Adapter.Disconnect(out responseBody);
#endregion
}