public void MSOXNSPI_S05_TC06_SeekEntriesFailedWithInvalidBookmark()
{
this.CheckProductSupported();
this.CheckMAPIHTTPTransportSupported();
#region Call NspiBind to initiate a session between the client and the server.
uint flags = 0;
STAT stat = new STAT();
stat.InitiateStat();
FlatUID_r guid = new FlatUID_r
{
Ab = new byte[16]
};
FlatUID_r? serverGuid = guid;
this.Result = this.ProtocolAdatper.NspiBind(flags, stat, ref serverGuid);
Site.Assert.AreEqual<ErrorCodeValue>(ErrorCodeValue.Success, this.Result, "NspiBind should return Success!");
#endregion
#region Call NspiSeekEntries with an invalid ContainerID field in the input parameter pStat, so that the address book container specified by the invalid ContainerID field cannot be located.
uint reservedOfSeekEntries = 0;
PropertyValue_r target = new PropertyValue_r
{
PropTag = (uint)AulProp.PidTagDisplayName,
Reserved = (uint)0x00
};
string displayName = Common.GetConfigurationPropertyValue("User1Name", this.Site);
if (this.Transport == "ncacn_http" || this.Transport == "ncacn_ip_tcp")
{
target.Value.LpszA = System.Text.Encoding.UTF8.GetBytes(displayName);
}
else
{
target.Value.LpszA = System.Text.Encoding.UTF8.GetBytes(displayName + "\0");
}
PropertyTagArray_r tags = new PropertyTagArray_r
{
CValues = 1,
AulPropTag = new uint[1]
{
target.PropTag
}
};
PropertyTagArray_r? propTagsOfSeekEntries = tags;
PropertyTagArray_r? tableOfSeekEntries = null;
PropertyRowSet_r? rowsOfSeekEntries;
stat.ContainerID = (uint)MinimalEntryID.MID_CURRENT;
STAT inputStat = stat;
this.Result = this.ProtocolAdatper.NspiSeekEntries(reservedOfSeekEntries, ref stat, target, tableOfSeekEntries, propTagsOfSeekEntries, out rowsOfSeekEntries);
#region Capture
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXNSPI_R1033");
// Verify MS-OXNSPI requirement: MS-OXNSPI_R1033
Site.CaptureRequirementIfAreEqual<ErrorCodeValue>(
ErrorCodeValue.InvalidBookmark,
this.Result,
1033,
@"[In NspiSeekEntries] [Server Processing Rules: Upon receiving message NspiSeekEntries, the server MUST process the data from the message subject to the following constraints:] [Constraint 6] If the server is unable to locate the address book container specified by the ContainerID field in the input parameter pStat, the server MUST return the return value ""InvalidBookmark"".");
this.VerifyParametersRelatedWithNspiSeekEntries(this.Result, rowsOfSeekEntries, inputStat, stat);
#endregion Capture
#endregion
#region Call NspiUnbind to destroy the session between the client and the server.
uint returnValue = this.ProtocolAdatper.NspiUnbind(0);
Site.Assert.AreEqual<uint>(1, returnValue, "NspiUnbind method should return 1 (Success).");
#endregion
}