Microsoft.Protocols.TestSuites.Rdpbcgr.RdpbcgrTestSuite.S1_ConnectionTest_BasicSettingExchange_PositiveTest_V1andV2RnsUdScEdgeActionsSupported C# (CSharp) Method

S1_ConnectionTest_BasicSettingExchange_PositiveTest_V1andV2RnsUdScEdgeActionsSupported() private method

        public void S1_ConnectionTest_BasicSettingExchange_PositiveTest_V1andV2RnsUdScEdgeActionsSupported()
        {
            #region Test Description
            /*
            This test case tests:
            1) The correctness of Client MCS Connect Initial PDU with GCC Conference Create Request
               when the server advertised support for Extended Client Data Blocks.
            2) SUT can process the valid Server MCS Connect Response PDU with GCC Conference Create Response
               with supporting RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V1 and RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V2 correctly.

            Test Execution Steps:
            1.	Trigger SUT to initiate a RDP connection and complete the Connection Initiation phase.
                Server should set the EXTENDED_CLIENT_DATA_SUPPORTED flag in RDP Negotiation Response.
            2.	Test Suite expects SUT continue the connection sequence with sending a
                Client MCS Connect Initial PDU with GCC Conference Create Request.
            3.	Verify the received Client MCS Connect Initial PDU with GCC Conference Create Request
                and respond Server MCS Connect Response PDU with GCC Conference Create Response.
                Server should set earlyCapabiliyFlags as RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V1 | RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V2 in TS_UD_SC_SEC1.
            4.	Test Suite expects a Client MCS Erect Domain Request PDU to indicate the successful process
                of Server MCS Connect Response PDU with GCC Conference Create Response.
            */
            #endregion

            #region Test Sequence

            //Start RDP listening.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Starting RDP listening with transport protocol: {0}", transportProtocol.ToString());
            this.rdpbcgrAdapter.StartRDPListening(transportProtocol);

            #region Trigger client to initiate a RDP connection
            //Trigger client to initiate a RDP connection.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Triggering SUT to initiate a RDP connection to server.");
            triggerClientRDPConnect(transportProtocol);
            #endregion

            //Expect the transport layer connection request
            this.TestSite.Log.Add(LogEntryKind.Comment, "Expecting SUT to start a transport layer connection request (TCP).");
            this.rdpbcgrAdapter.ExpectTransportConnection(RDPSessionType.Normal);

            //Expect SUT send a Client X.224 Connection Request PDU.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Expecting SUT to send a Client X.224 Connection Request PDU");
            this.rdpbcgrAdapter.ExpectPacket<Client_X_224_Connection_Request_Pdu>(waitTime);

            //Respond a Server X.224 Connection Confirm PDU and set the EXTENDED_CLIENT_DATA_SUPPORTED flag.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Sending Server X.224 Connection Confirm PDU to SUT. Selected protocol: {0}; Extended Client Data supported: true", selectedProtocol.ToString());
            this.rdpbcgrAdapter.Server_X_224_Connection_Confirm(selectedProtocol, true, true, NegativeType.None);

            //Expect SUT send Client MCS Connect Initial PDU.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Expecting SUT to send a Client MCS Connect Initial PDU.");
            this.rdpbcgrAdapter.ExpectPacket<Client_MCS_Connect_Initial_Pdu_with_GCC_Conference_Create_Request>(waitTime);

            //if (this.rdpbcgrAdapter.SessionContext.ClientRequestedProtocol == null)
            //{

            //}

            /*
             * A 32-bit, unsigned integer that contains the flags sent by the client in the requestedProtocols field of the RDP Negotiation Request (section 2.2.1.1.1). In the event that an RDP Negotiation Request was not received from the client, this field MUST be initialized to PROTOCOL_RDP (0). If this field is not present, all of the subsequent fields MUST NOT be present.
              not sure when these cases for earlyCapabilityFlags are not needed!
             */

            //Respond A Server MCS Connect Response PDU with GCC Conference Create Response.
            SC_earlyCapabilityFlags_Values earlyCapabilityFlagsValue = SC_earlyCapabilityFlags_Values.RNS_UD_SC_EDGE_ACTIONS_SUPPORTED | SC_earlyCapabilityFlags_Values.RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V2;
            this.TestSite.Log.Add(LogEntryKind.Comment, "Sending Server MCS Connect Response PDU to SUT. Encryption Method {0}; Encryption Level: {1}; RDP Version Code: {2}; EarlyCapabilityFlags: {3}.", enMethod.ToString(), enLevel.ToString(), TS_UD_SC_CORE_version_Values.V2.ToString(), SC_earlyCapabilityFlags_Values.RNS_UD_SC_DYNAMIC_DST_SUPPORTED.ToString() + " | " + SC_earlyCapabilityFlags_Values.RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V2.ToString());
            this.rdpbcgrAdapter.Server_MCS_Connect_Response(enMethod, enLevel, TS_UD_SC_CORE_version_Values.V2, NegativeType.None, MULTITRANSPORT_TYPE_FLAGS.None, true, earlyCapabilityFlagsValue);

            //Expect a Client MCS Erect Domain Request PDU.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Expecting SUT to send a Client MCS Erect Domain Request PDU.");
            this.rdpbcgrAdapter.ExpectPacket<Client_MCS_Erect_Domain_Request>(waitTime);

            #endregion
        }
RdpbcgrTestSuite