private void VerifyRopCreateFolder(RopCreateFolderResponse createFolderResponse)
{
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R58");
// If the RopCreateFolder operation returns successfully, it indicates that the server creates a new folder.
// Verify MS-OXCFOLD requirement: MS-OXCFOLD_R58
Site.CaptureRequirementIfAreEqual<uint>(
Constants.SuccessCode,
createFolderResponse.ReturnValue,
58,
@"[RopCreateFolder ROP Response Buffer] ReturnValue (4 bytes): The server returns 0x00000000 to indicate success.");
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R37");
// Verify MS-OXCFOLD requirement: MS-OXCFOLD_R37
Site.CaptureRequirementIfAreEqual<uint>(
Constants.SuccessCode,
createFolderResponse.ReturnValue,
37,
@"[In RopCreateFolder ROP] The RopCreateFolder ROP ([MS-OXCROPS] section 2.2.4.2) creates a new folder.");
if (createFolderResponse.IsExistingFolder != 0)
{
Site.Assert.IsNotNull(createFolderResponse.IsGhosted, "[In RopCreateFolder Rop response] The IsGhosted field should be present when the IsExistingFolder field is set to a nonzero (TRUE) value.");
if (createFolderResponse.IsGhosted != 0)
{
Site.Assert.IsNotNull(createFolderResponse.ServerCount, "[In RopCreateFolder Rop response] The ServerCount field should be present when the IsGhosted field is set to a nonzero (TRUE) value.");
Site.Assert.IsNotNull(createFolderResponse.CheapServerCount, "[In RopCreateFolder Rop response] The CheapServerCount field should be present when the IsGhosted field is set to a nonzero (TRUE) value.");
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R936");
// Verify MS-OXCFOLD requirement: MS-OXCFOLD_R936
Site.CaptureRequirementIfIsTrue(
createFolderResponse.CheapServerCount <= createFolderResponse.ServerCount,
936,
@"[In RopCreateFolder ROP Response Buffer] The value of this field [CheapServerCount] MUST be less than or equal to the value of the ServerCount field.");
if (createFolderResponse.ServerCount > 0)
{
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R937");
// Verify MS-OXCFOLD requirement: MS-OXCFOLD_R937
Site.CaptureRequirementIfIsTrue(
createFolderResponse.CheapServerCount > 0,
937,
@"[In RopCreateFolder ROP Response Buffer] And [the value of this field ""CheapServerCount""] MUST be greater than zero when the value of the ServerCount field is greater than zero.");
}
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R940, the number of strings contained in field Servers is {0}, the ServerCount is {1}.", createFolderResponse.Servers.Length, createFolderResponse.ServerCount);
bool isVerifiedR940 = false;
if (createFolderResponse.Servers == null)
{
isVerifiedR940 = createFolderResponse.ServerCount == 0;
}
else
{
isVerifiedR940 = createFolderResponse.ServerCount == (ushort)createFolderResponse.Servers.Length;
}
// Verify MS-OXCFOLD requirement: MS-OXCFOLD_R940.
Site.CaptureRequirementIfIsTrue(
isVerifiedR940,
940,
@"[In RopCreateFolder ROP Response Buffer] The number of strings contained in this field [Servers] is specified by the ServerCount field.");
}
}
}
#endregion