コード例 #1
0
        public void MSOXCROPS_S06_TC05_TestRopsSetProperties()
        {
            this.CheckTransportIsSupported();

            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));

            // Step 1: Preparations-Create message and get the created message handle.
            #region Preparations

            // Log on to a private mailbox.
            RopLogonResponse logonResponse = Logon(LogonType.Mailbox, this.userDN, out inputObjHandle);

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Step 1:Call GetCreatedMessageHandle method to create message and get the created message handle.");

            // Call GetCreatedMessageHandle method to create message and get the created message handle.
            uint messageHandle = GetCreatedMessageHandle(logonResponse.FolderIds[4], inputObjHandle);

            int size = 0;
            TaggedPropertyValue[] taggedPropertyValueArray = this.CreateMessageTaggedPropertyValueArray(out size);

            #endregion

            // Step 2: Send the RopSetProperties request and verify the success response.
            #region RopSetProperties success response

            RopSetPropertiesRequest setPropertiesRequest = new RopSetPropertiesRequest();
            RopSetPropertiesResponse setPropertiesResponse;

            setPropertiesRequest.RopId = (byte)RopId.RopSetProperties;
            setPropertiesRequest.LogonId = TestSuiteBase.LogonId;
            setPropertiesRequest.InputHandleIndex = TestSuiteBase.InputHandleIndex0;
            setPropertiesRequest.PropertyValueSize = (ushort)(size + 2);
            setPropertiesRequest.PropertyValueCount = (ushort)taggedPropertyValueArray.Length;
            setPropertiesRequest.PropertyValues = taggedPropertyValueArray;

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Step 2: Begin to send the RopSetProperties request.");

            // Send the RopSetProperties request and verify the success response.
            this.responseSOHs = cropsAdapter.ProcessSingleRop(
                setPropertiesRequest,
                messageHandle,
                ref this.response,
                ref this.rawData,
                RopResponseType.SuccessResponse);
            setPropertiesResponse = (RopSetPropertiesResponse)response;

            Site.Assert.AreEqual<uint>(
                TestSuiteBase.SuccessReturnValue,
                setPropertiesResponse.ReturnValue,
                "if ROP succeeds, ReturnValue of its response will be 0 (success)");

            #endregion

            // Step 3: Send the RopSetProperties request and verify the failure response.
            #region RopSetProperties failure response

            setPropertiesRequest.InputHandleIndex = TestSuiteBase.InputHandleIndex1;

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Step 3: Begin to send the RopSetProperties request.");

            this.responseSOHs = cropsAdapter.ProcessSingleRop(
                setPropertiesRequest,
                messageHandle,
                ref this.response,
                ref this.rawData,
                RopResponseType.FailureResponse);
            setPropertiesResponse = (RopSetPropertiesResponse)response;

            Site.Assert.AreNotEqual<uint>(
                TestSuiteBase.SuccessReturnValue,
                setPropertiesResponse.ReturnValue,
                "if ROP failure, ReturnValue of its response will not be 0 (success)");
            Site.Assert.AreNotEqual<uint>(
                MS_OXCROPSAdapter.ReturnValueForRopQueryNamedProperties,
                setPropertiesResponse.ReturnValue,
                "if ROP failure, ReturnValue of its response will not be 0x00040380 (success)");

            #endregion

            // Step 4: Send the RopSetPropertiesNoReplicate request and verify the success response.
            #region RopSetPropertiesNoReplicate success response

            RopSetPropertiesNoReplicateRequest setPropertiesNoReplicateRequest = new RopSetPropertiesNoReplicateRequest();
            RopSetPropertiesNoReplicateResponse setPropertiesNoReplicateResponse;

            setPropertiesNoReplicateRequest.RopId = (byte)RopId.RopSetPropertiesNoReplicate;
            setPropertiesNoReplicateRequest.LogonId = TestSuiteBase.LogonId;
            setPropertiesNoReplicateRequest.InputHandleIndex = TestSuiteBase.InputHandleIndex0;
            setPropertiesNoReplicateRequest.PropertyValueSize = (ushort)(size + 2);
            setPropertiesNoReplicateRequest.PropertyValueCount = (ushort)taggedPropertyValueArray.Length;
            setPropertiesNoReplicateRequest.PropertyValues = taggedPropertyValueArray;

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Step 4: Begin to send the RopSetPropertiesNoReplicate request.");

            // Send the RopSetPropertiesNoReplicate request and verify the success response.
            this.responseSOHs = cropsAdapter.ProcessSingleRop(
                setPropertiesNoReplicateRequest,
                messageHandle,
                ref this.response,
                ref this.rawData,
                RopResponseType.SuccessResponse);
            setPropertiesNoReplicateResponse = (RopSetPropertiesNoReplicateResponse)response;

            Site.Assert.AreEqual<uint>(
                TestSuiteBase.SuccessReturnValue,
                setPropertiesNoReplicateResponse.ReturnValue,
                "If ROP succeeds, the ReturnValue of its response is 0(success).");

            #endregion

            // Step 5: Send the RopSetPropertiesNoReplicate request and verify the failure response.
            #region RopSetPropertiesNoReplicate failure response

            setPropertiesNoReplicateRequest.InputHandleIndex = TestSuiteBase.InputHandleIndex1;

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Step 5: Begin to send the RopSetPropertiesNoReplicate request.");

            // Send the RopSetPropertiesNoReplicate request and verify the failure response.
            this.responseSOHs = cropsAdapter.ProcessSingleRop(
                setPropertiesNoReplicateRequest,
                messageHandle,
                ref this.response,
                ref this.rawData,
                RopResponseType.FailureResponse);
            setPropertiesNoReplicateResponse = (RopSetPropertiesNoReplicateResponse)response;

            Site.Assert.AreNotEqual<uint>(
                TestSuiteBase.SuccessReturnValue,
                setPropertiesNoReplicateResponse.ReturnValue,
                "If ROP failure, the ReturnValue of its response is not 0(success).");

            #endregion
        }