//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18449
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Microsoft.Protocols.TestSuites.MS_OXCTABL {
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Reflection;
    using Microsoft.SpecExplorer.Runtime.Testing;
    using Microsoft.Protocols.TestTools;
    
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Spec Explorer", "3.5.3130.0")]
    [Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()]
    public partial class S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite : PtfTestClassBase {
        
        public S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite() {
            this.SetSwitch("ProceedControlTimeout", "100");
            this.SetSwitch("QuiescenceTimeout", "2000000");
        }
        
        #region Expect Delegates
        public delegate void CheckMAPIHTTPTransportSupportedDelegate1(bool isSupported);
        
        public delegate void RopGetCollapseStateResponseDelegate1(bool isSetCollapseStateCalled, bool isCollapseStateRebuildCorrectly);
        #endregion
        
        #region Event Metadata
        static System.Reflection.MethodBase CheckMAPIHTTPTransportSupportedInfo = TestManagerHelpers.GetMethodInfo(typeof(Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter), "CheckMAPIHTTPTransportSupported", typeof(bool).MakeByRefType());
        
        static System.Reflection.EventInfo RopGetCollapseStateResponseInfo = TestManagerHelpers.GetEventInfo(typeof(Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter), "RopGetCollapseStateResponse");
        #endregion
        
        #region Adapter Instances
        private Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter IMS_OXCTABLAdapterInstance;
        #endregion
        
        #region Class Initialization and Cleanup
        [Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute()]
        public static void ClassInitialize(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext context) {
            PtfTestClassBase.Initialize(context);
        }
        
        [Microsoft.VisualStudio.TestTools.UnitTesting.ClassCleanupAttribute()]
        public static void ClassCleanup() {
            PtfTestClassBase.Cleanup();
        }
        #endregion
        
        #region Test Initialization and Cleanup
        protected override void TestInitialize() {
            this.InitializeTestManager();
            this.IMS_OXCTABLAdapterInstance = ((Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter)(this.Manager.GetAdapter(typeof(Microsoft.Protocols.TestSuites.MS_OXCTABL.IMS_OXCTABLAdapter))));
            this.Manager.Subscribe(RopGetCollapseStateResponseInfo, this.IMS_OXCTABLAdapterInstance);
        }
        
        protected override void TestCleanup() {
            base.TestCleanup();
            this.CleanupTestManager();
        }
        #endregion
        
        #region Test Starting in S0
        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
        public void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite() {
            this.Manager.BeginTest("MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite");
            this.Manager.Comment("reaching state \'S0\'");
            bool temp0;
            this.Manager.Comment("executing step \'call CheckMAPIHTTPTransportSupported(out _)\'");
            this.IMS_OXCTABLAdapterInstance.CheckMAPIHTTPTransportSupported(out temp0);
            this.Manager.AddReturn(CheckMAPIHTTPTransportSupportedInfo, null, temp0);
            this.Manager.Comment("reaching state \'S1\'");
            int temp2 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteCheckMAPIHTTPTransportSupportedChecker)), new ExpectedReturn(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteCheckMAPIHTTPTransportSupportedChecker1)));
            if ((temp2 == 0)) {
                this.Manager.Comment("reaching state \'S8\'");
                goto label0;
            }
            if ((temp2 == 1)) {
                this.Manager.Comment("reaching state \'S9\'");
                this.Manager.Comment("executing step \'call InitializeTable(INVALID_TABLE)\'");
                this.IMS_OXCTABLAdapterInstance.InitializeTable(Microsoft.Protocols.TestSuites.MS_OXCTABL.TableType.INVALID_TABLE);
                this.Manager.Comment("reaching state \'S16\'");
                this.Manager.Comment("checking step \'return InitializeTable\'");
                this.Manager.Comment("reaching state \'S20\'");
                Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp1;
                this.Manager.Comment("executing step \'call RopGetCollapseState()\'");
                temp1 = this.IMS_OXCTABLAdapterInstance.RopGetCollapseState();
                this.Manager.Checkpoint("MS-OXCTABL_R290");
                this.Manager.Comment("reaching state \'S24\'");
                this.Manager.Comment("checking step \'return RopGetCollapseState/ecNotSupported\'");
                TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues.ecNotSupported, temp1, "return of RopGetCollapseState, state S24");
                this.Manager.Comment("reaching state \'S28\'");
                if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.RopGetCollapseStateResponseInfo, null, new RopGetCollapseStateResponseDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteRopGetCollapseStateResponseChecker))) != -1)) {
                    S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteS30();
                }
                else {
                    this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.RopGetCollapseStateResponseInfo, null, new RopGetCollapseStateResponseDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteRopGetCollapseStateResponseChecker)));
                }
                goto label0;
            }
            throw new InvalidOperationException("never reached");
        label0:
;
            this.Manager.EndTest();
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteCheckMAPIHTTPTransportSupportedChecker(bool isSupported) {
            this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out False]\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S1");
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteCheckMAPIHTTPTransportSupportedChecker1(bool isSupported) {
            this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out True]\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S1");
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteRopGetCollapseStateResponseChecker(bool isSetCollapseStateCalled, bool isCollapseStateRebuildCorrectly) {
            this.Manager.Comment("checking step \'event RopGetCollapseStateResponse(False,False)\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isSetCollapseStateCalled, "isSetCollapseStateCalled of RopGetCollapseStateResponse, state S28");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isCollapseStateRebuildCorrectly, "isCollapseStateRebuildCorrectly of RopGetCollapseStateResponse, state S28");
        }
        
        private void S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteS30() {
            this.Manager.Comment("reaching state \'S30\'");
        }
        #endregion
        
        #region Test Starting in S2
        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
        public void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite1() {
            this.Manager.BeginTest("MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite1");
            this.Manager.Comment("reaching state \'S2\'");
            bool temp3;
            this.Manager.Comment("executing step \'call CheckMAPIHTTPTransportSupported(out _)\'");
            this.IMS_OXCTABLAdapterInstance.CheckMAPIHTTPTransportSupported(out temp3);
            this.Manager.AddReturn(CheckMAPIHTTPTransportSupportedInfo, null, temp3);
            this.Manager.Comment("reaching state \'S3\'");
            int temp5 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite1CheckMAPIHTTPTransportSupportedChecker)), new ExpectedReturn(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite1CheckMAPIHTTPTransportSupportedChecker1)));
            if ((temp5 == 0)) {
                this.Manager.Comment("reaching state \'S10\'");
                this.Manager.Comment("executing step \'call InitializeTable(ATTACHMENTS_TABLE)\'");
                this.IMS_OXCTABLAdapterInstance.InitializeTable(Microsoft.Protocols.TestSuites.MS_OXCTABL.TableType.ATTACHMENTS_TABLE);
                this.Manager.Comment("reaching state \'S17\'");
                this.Manager.Comment("checking step \'return InitializeTable\'");
                this.Manager.Comment("reaching state \'S21\'");
                Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp4;
                this.Manager.Comment("executing step \'call RopSetCollapseState()\'");
                temp4 = this.IMS_OXCTABLAdapterInstance.RopSetCollapseState();
                this.Manager.Checkpoint("MS-OXCTABL_R590");
                this.Manager.Comment("reaching state \'S25\'");
                this.Manager.Comment("checking step \'return RopSetCollapseState/ecNotSupported\'");
                TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues.ecNotSupported, temp4, "return of RopSetCollapseState, state S25");
                S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteS29();
                goto label1;
            }
            if ((temp5 == 1)) {
                this.Manager.Comment("reaching state \'S11\'");
                goto label1;
            }
            throw new InvalidOperationException("never reached");
        label1:
;
            this.Manager.EndTest();
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite1CheckMAPIHTTPTransportSupportedChecker(bool isSupported) {
            this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out True]\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S3");
        }
        
        private void S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteS29() {
            this.Manager.Comment("reaching state \'S29\'");
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite1CheckMAPIHTTPTransportSupportedChecker1(bool isSupported) {
            this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out False]\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S3");
        }
        #endregion
        
        #region Test Starting in S4
        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
        public void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite2() {
            this.Manager.BeginTest("MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite2");
            this.Manager.Comment("reaching state \'S4\'");
            bool temp6;
            this.Manager.Comment("executing step \'call CheckMAPIHTTPTransportSupported(out _)\'");
            this.IMS_OXCTABLAdapterInstance.CheckMAPIHTTPTransportSupported(out temp6);
            this.Manager.AddReturn(CheckMAPIHTTPTransportSupportedInfo, null, temp6);
            this.Manager.Comment("reaching state \'S5\'");
            int temp8 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite2CheckMAPIHTTPTransportSupportedChecker)), new ExpectedReturn(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite2CheckMAPIHTTPTransportSupportedChecker1)));
            if ((temp8 == 0)) {
                this.Manager.Comment("reaching state \'S12\'");
                this.Manager.Comment("executing step \'call InitializeTable(INVALID_TABLE)\'");
                this.IMS_OXCTABLAdapterInstance.InitializeTable(Microsoft.Protocols.TestSuites.MS_OXCTABL.TableType.INVALID_TABLE);
                this.Manager.Comment("reaching state \'S18\'");
                this.Manager.Comment("checking step \'return InitializeTable\'");
                this.Manager.Comment("reaching state \'S22\'");
                Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp7;
                this.Manager.Comment("executing step \'call RopSetCollapseState()\'");
                temp7 = this.IMS_OXCTABLAdapterInstance.RopSetCollapseState();
                this.Manager.Checkpoint("MS-OXCTABL_R306");
                this.Manager.Comment("reaching state \'S26\'");
                this.Manager.Comment("checking step \'return RopSetCollapseState/ecNotSupported\'");
                TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues.ecNotSupported, temp7, "return of RopSetCollapseState, state S26");
                S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteS30();
                goto label2;
            }
            if ((temp8 == 1)) {
                this.Manager.Comment("reaching state \'S13\'");
                goto label2;
            }
            throw new InvalidOperationException("never reached");
        label2:
;
            this.Manager.EndTest();
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite2CheckMAPIHTTPTransportSupportedChecker(bool isSupported) {
            this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out True]\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S5");
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite2CheckMAPIHTTPTransportSupportedChecker1(bool isSupported) {
            this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out False]\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S5");
        }
        #endregion
        
        #region Test Starting in S6
        [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
        public void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3() {
            this.Manager.BeginTest("MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3");
            this.Manager.Comment("reaching state \'S6\'");
            bool temp9;
            this.Manager.Comment("executing step \'call CheckMAPIHTTPTransportSupported(out _)\'");
            this.IMS_OXCTABLAdapterInstance.CheckMAPIHTTPTransportSupported(out temp9);
            this.Manager.AddReturn(CheckMAPIHTTPTransportSupportedInfo, null, temp9);
            this.Manager.Comment("reaching state \'S7\'");
            int temp11 = this.Manager.ExpectReturn(this.QuiescenceTimeout, true, new ExpectedReturn(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3CheckMAPIHTTPTransportSupportedChecker)), new ExpectedReturn(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.CheckMAPIHTTPTransportSupportedInfo, null, new CheckMAPIHTTPTransportSupportedDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3CheckMAPIHTTPTransportSupportedChecker1)));
            if ((temp11 == 0)) {
                this.Manager.Comment("reaching state \'S14\'");
                this.Manager.Comment("executing step \'call InitializeTable(ATTACHMENTS_TABLE)\'");
                this.IMS_OXCTABLAdapterInstance.InitializeTable(Microsoft.Protocols.TestSuites.MS_OXCTABL.TableType.ATTACHMENTS_TABLE);
                this.Manager.Comment("reaching state \'S19\'");
                this.Manager.Comment("checking step \'return InitializeTable\'");
                this.Manager.Comment("reaching state \'S23\'");
                Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues temp10;
                this.Manager.Comment("executing step \'call RopGetCollapseState()\'");
                temp10 = this.IMS_OXCTABLAdapterInstance.RopGetCollapseState();
                this.Manager.Checkpoint("MS-OXCTABL_R584");
                this.Manager.Comment("reaching state \'S27\'");
                this.Manager.Comment("checking step \'return RopGetCollapseState/ecNotSupported\'");
                TestManagerHelpers.AssertAreEqual<Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues>(this.Manager, Microsoft.Protocols.TestSuites.MS_OXCTABL.TableRopReturnValues.ecNotSupported, temp10, "return of RopGetCollapseState, state S27");
                this.Manager.Comment("reaching state \'S31\'");
                if ((this.Manager.ExpectEvent(this.QuiescenceTimeout, true, new ExpectedEvent(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.RopGetCollapseStateResponseInfo, null, new RopGetCollapseStateResponseDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3RopGetCollapseStateResponseChecker))) != -1)) {
                    S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuiteS29();
                }
                else {
                    this.Manager.CheckObservationTimeout(false, new ExpectedEvent(S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite.RopGetCollapseStateResponseInfo, null, new RopGetCollapseStateResponseDelegate1(this.MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3RopGetCollapseStateResponseChecker)));
                }
                goto label3;
            }
            if ((temp11 == 1)) {
                this.Manager.Comment("reaching state \'S15\'");
                goto label3;
            }
            throw new InvalidOperationException("never reached");
        label3:
;
            this.Manager.EndTest();
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3CheckMAPIHTTPTransportSupportedChecker(bool isSupported) {
            this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out True]\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, true, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S7");
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3RopGetCollapseStateResponseChecker(bool isSetCollapseStateCalled, bool isCollapseStateRebuildCorrectly) {
            this.Manager.Comment("checking step \'event RopGetCollapseStateResponse(False,False)\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isSetCollapseStateCalled, "isSetCollapseStateCalled of RopGetCollapseStateResponse, state S31");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isCollapseStateRebuildCorrectly, "isCollapseStateRebuildCorrectly of RopGetCollapseStateResponse, state S31");
        }
        
        private void MSOXCTABL_S04_ExpandRowRops_GetorSetCollapseRowNotSupported_TestSuite3CheckMAPIHTTPTransportSupportedChecker1(bool isSupported) {
            this.Manager.Comment("checking step \'return CheckMAPIHTTPTransportSupported/[out False]\'");
            TestManagerHelpers.AssertAreEqual<bool>(this.Manager, false, isSupported, "isSupported of CheckMAPIHTTPTransportSupported, state S7");
        }
        #endregion
    }
}
