public void MSOXCROPS_S01_TC11_TestStoreStateOfLogon()
{
this.CheckTransportIsSupported();
// Step 1: Set the StoreState to 0 and send the Logon ROP Request.
#region RopLogon success response
this.cropsAdapter.RpcConnect(
Common.GetConfigurationPropertyValue("SutComputerName", this.Site),
ConnectionType.PrivateMailboxServer,
Common.GetConfigurationPropertyValue("UserEssdn", this.Site),
Common.GetConfigurationPropertyValue("Domain", this.Site),
Common.GetConfigurationPropertyValue("AdminUserName", this.Site),
Common.GetConfigurationPropertyValue("PassWord", this.Site));
RopLogonRequest logonRequest;
logonRequest.RopId = (byte)RopId.RopLogon;
logonRequest.LogonId = TestSuiteBase.LogonId;
// Set OutputHandleIndex to 0x0, which specifies the location in the Server object handle table
// where the handle for the output Server object will be stored.
logonRequest.OutputHandleIndex = TestSuiteBase.OutputHandleIndex0;
string userDN = Common.GetConfigurationPropertyValue("UserEssdn", this.Site) + "\0";
// Set StoreState to 0, this field is not used and is ignored by the server.
logonRequest.StoreState = (uint)StoreState.None;
logonRequest.LogonFlags = (byte)LogonFlags.Private;
logonRequest.OpenFlags = (uint)OpenFlags.UsePerMDBReplipMapping;
// Set EssdnSize to the byte count of user DN, which specifies the size of the Essdn field.
logonRequest.EssdnSize = (ushort)Encoding.ASCII.GetByteCount(userDN);
// Set Essdn to the content of user DN, which specifies it will log on to the mail box of user represented by the user DN.
logonRequest.Essdn = Encoding.ASCII.GetBytes(userDN);
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Step 1: Begin to send the RopLogon request.");
// Send the RopLogon request and get the response.
this.responseSOHs = cropsAdapter.ProcessSingleRop(
logonRequest,
this.inputObjHandle,
ref this.response,
ref this.rawData,
RopResponseType.SuccessResponse);
RopLogonResponse logonResponse = (RopLogonResponse)response;
Site.Assert.AreEqual<uint>(
TestSuiteBase.SuccessReturnValue,
logonResponse.ReturnValue,
"If ROP succeeds, the ReturnValue of its response is 0 (success)");
#endregion
// Step 2: Set the StoreState to a value other than 0 and send the request again.
#region Send the request again by setting StoreState to 1
logonRequest.StoreState = (uint)StoreState.StoreHasSearches;
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Step 2: Begin to send the RopLogon request.");
cropsAdapter.ProcessSingleRop(
logonRequest,
this.inputObjHandle,
ref this.response,
ref this.rawData,
RopResponseType.SuccessResponse);
RopLogonResponse logonResponse2 = (RopLogonResponse)response;
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R4678");
// Verify MS-OXCROPS requirement: MS-OXCROPS_R4678
Site.CaptureRequirementIfAreEqual<uint>(
logonResponse.ReturnValue,
logonResponse2.ReturnValue,
4678,
@"[In RopLogon ROP Request Buffer] StoreState (4 bytes): Reply is the same no matter what values are used for this field.");
#endregion
}