public void MSOXNSPI_S05_TC01_BindFlagWithfAnonymousLogin()
{
this.CheckProductSupported();
this.CheckMAPIHTTPTransportSupported();
#region Call NspiBind to initiate a session between the client and the server. The input parameter dwFlags in this request is set to a value that is not "fAnonymousLogin".
STAT stat = new STAT();
stat.InitiateStat();
FlatUID_r guid = new FlatUID_r
{
Ab = new byte[16]
};
FlatUID_r? serverGuid = guid;
uint flags = 0x0;
// A value of "fAnonymousLogin" in the input parameter dwFlags indicates that the server
// does not validate that the client is an authenticated user. The server MAY ignore this request.
ErrorCodeValue result1 = this.ProtocolAdatper.NspiBind(flags, stat, ref serverGuid);
#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
#region Call NspiBind to initiate another session between the client and the server. The input parameter dwFlags in this request is set to "fAnonymousLogin".
// Set dwFlags to fAnonymousLogin: 0x00000020.
flags = (uint)NspiBindFlag.fAnonymousLogin;
ErrorCodeValue result2 = this.ProtocolAdatper.NspiBind(flags, stat, ref serverGuid);
#region Verify the requirements about NspiBind operation.
if (Common.IsRequirementEnabled(1613, this.Site))
{
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXNSPI_R1613, the value of result1 is {0}, the value of result2 is {1}", result1, result2);
// Verify MS-OXNSPI requirement: MS-OXNSPI_R1613
Site.CaptureRequirementIfIsTrue(
result1 != result2,
1613,
@"[In Appendix B: Product Behavior] Implementation does not ignore this request [a value of ""fAnonymousLogin"" in the input parameter dwFlags]. (Exchange 2010 and above follow this behavior.)");
}
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R927");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R927
Site.CaptureRequirementIfAreEqual<ErrorCodeValue>(
ErrorCodeValue.NotSupported,
result2,
"MS-OXCDATA",
927,
@"[In Error Codes] NotSupported (MAPI_E_NO_SUPPORT, ecNotSupported, ecNotImplemented) will be returned, if the server does not support this method call.");
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R928");
// Verify MS-OXCDATA requirement: MS-OXCDATA_R928
Site.CaptureRequirementIfAreEqual<uint>(
0x80040102,
(uint)result2,
"MS-OXCDATA",
928,
@"[In Error Codes] The numeric value (hex) for error code NotSupported is 0x80040102, %x02.01.04.80.");
#endregion
#endregion
}