private void VerifyPropertyName(PropertyName propertyName)
{
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R17, The actual value of Kind is {0}", propertyName.Kind);
// Verify MS-OXCDATA requirement: MS-OXCDATA_R17.
bool isVerifyR17 = propertyName.Kind == 0x00 ||
propertyName.Kind == 0x01 ||
propertyName.Kind == 0xFF;
Site.CaptureRequirementIfIsTrue(
isVerifyR17,
"MS-OXCDATA",
17,
@"[In PropertyName Structure] Kind (1 byte): The possible values [0x00, 0x01, 0xFF] for the Kind field are in the following table.");
if (propertyName.Kind == 0x00)
{
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R25");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R25.
// LID is not 0 means it is present.
Site.CaptureRequirementIfIsNotNull(
propertyName.LID,
"MS-OXCDATA",
25,
@"[In PropertyName Structure] LID (optional) (4 bytes): This field is present only if the value of the Kind field is equal to 0x00.");
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R26");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R26.
Site.CaptureRequirementIfAreEqual<Type>(
typeof(uint),
propertyName.LID.GetType(),
"MS-OXCDATA",
26,
@"[In PropertyName Structure] LID (optional) (4 bytes): An unsigned integer that identifies the named property within its property set.");
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R27");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R27.
// NameSize!=null means NameSize present.
Site.CaptureRequirementIfIsNull(
propertyName.NameSize,
"MS-OXCDATA",
27,
@"[In PropertyName Structure] NameSize (optional) (1 byte): This field is present only if the value of the Kind field is equal to 0x01.");
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R29");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R29.
// That Name does not equal null means Name presents.
Site.CaptureRequirementIfIsNull(
propertyName.Name,
"MS-OXCDATA",
29,
@"[In PropertyName Structure] Name (optional) (variable): This field is present only if Kind is equal to 0x01.");
}
else
{
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R25");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R25.
// LID is not 0 means it is present.
Site.CaptureRequirementIfIsNull(
propertyName.LID,
"MS-OXCDATA",
25,
@"[In PropertyName Structure] LID (optional) (4 bytes): This field is present only if the value of the Kind field is equal to 0x00.");
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R27");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R27.
// NameSize!=null means NameSize present.
Site.CaptureRequirementIfIsNotNull(
propertyName.NameSize,
"MS-OXCDATA",
27,
@"[In PropertyName Structure] NameSize (optional) (1 byte): This field is present only if the value of the Kind field is equal to 0x01.");
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R29");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R29.
// That Name does not equal null means Name presents.
Site.CaptureRequirementIfIsNotNull(
propertyName.Name,
"MS-OXCDATA",
29,
@"[In PropertyName Structure] Name (optional) (variable): This field is present only if Kind is equal to 0x01.");
}
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXORULE_R941");
// Verify MS-OXORULE requirement: MS-OXORULE_R941.
// The format of the PropertyName structure has been verified by the above capture code, so R941 can be verified directly.
Site.CaptureRequirement(
941,
@"[In NamedPropertyInformation Structure] The format of the PropertyName structure is specified in [MS-OXCDATA] section 2.6.1.");
}