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

S7_StaticVirtualChannel_NegativeTest_InvalidMCSLength() private method

        public void S7_StaticVirtualChannel_NegativeTest_InvalidMCSLength()
        {
            #region Test Description
            /*
            1.  Trigger SUT to initiate and complete a RDP connection.
            2.  After the connection expectConnectionDisconnectionSequence has been finished, TestSuite sends a Server_Save_Session_Info_Pdu Session infoType_Values PDU Client_MCS_Connect_Initial_Pdu_with_GCC_Conference_Create_Request an ErrorNotificationType_Values type offscreenSupportLevel_Values the INFOTYPE_LOGON (0x00000000),
                INFOTYPE_LOGON_LONG (0x00000001), orderFlags_Values INFOTYPE_LOGON_PLAINNOTIFY (0x00000002) to notify the SUT that the Client_MCS_Attach_User_Request has DR_CORE_USER_LOGGEDON on (how to determine the notification type is described in CAPABILITY_HEADER section 3.3.5.10) .
            3.  TestSuite sends SUT a StaticVirtualChannel_InvalidType Virtual Channel_Options PDU and set the length Field of mcsPdu to and invalid ValueType (less than the actual ValueType).
            4.  TestSuite expects SUT drops the connection.
            */
            #endregion

            #region Test Sequence
            this.TestSite.Assert.IsTrue(isClientSupportRDPEFS, "To execute test cases of S7, RDP client should support [MS-RDPEFS]: Remote Desktop Protocol: File System Virtual Channel Extension.");
            //Start RDP listening.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Starting RDP listening.");
            this.rdpbcgrAdapter.StartRDPListening(transportProtocol);

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

            //Waiting for the transport level connection request.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Expecting the transport layer connection request.");
            this.rdpbcgrAdapter.ExpectTransportConnection(RDPSessionType.Normal);

            //Set Server Capability with Bitmap Host Cache supported.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Setting Server Capability. Virtual Channel compression is not supported.");
            this.rdpbcgrAdapter.SetServerCapability(true, true, true, true, true, true, true, true, false, true);

            //Waiting for the RDP connection sequence.
            this.TestSite.Log.Add(LogEntryKind.Comment, "Establishing RDP connection.");
            this.rdpbcgrAdapter.EstablishRDPConnection(selectedProtocol, enMethod, enLevel, true, false, rdpServerVersion);

            this.TestSite.Log.Add(LogEntryKind.Comment, "Sending Server Save Session Info PDU to SUT to notify user has logged on.");
            this.rdpbcgrAdapter.ServerSaveSessionInfo(LogonNotificationType.UserLoggedOn, ErrorNotificationType_Values.LOGON_FAILED_OTHER);

            //Check whether 'rdpdr' channel has been created
            if (this.rdpbcgrAdapter.GetStaticVirtualChannelId("RDPDR") == 0)
            {
                this.TestSite.Assume.Fail("The necessary channel RDPDR has not been created, so stop running this test case.");
            }

            this.TestSite.Log.Add(LogEntryKind.Comment, "Sending SUT a Static Virtual Channel PDU and filling the length field of mcsPdu to an invalid value (less than the actual value)");
            SendStaticVirtualChannelTraffics(StaticVirtualChannel_InvalidType.InvalidMCSLength);

            this.TestSite.Log.Add(LogEntryKind.Comment, "Expecting SUT drop the connection.");
            bool isDisconnected = this.rdpbcgrAdapter.WaitForDisconnection(waitTime);
            this.TestSite.Assert.IsTrue(isDisconnected, "SUT should drop the connection when received an invalid static virtual channel pdu.");
            #endregion
        }
RdpbcgrTestSuite