/// <summary>
        /// Creates and returns a new instance of MockClusterConnection with default settings.
        /// </summary>
        public MockClusterConnection CreateMockClusterConnection()
        {
            var mockClusterConnection = new MockClusterConnection
            {
                ApiNameArray = new[] { TestConstants.SendHealthReportApiName },
            };

            return(mockClusterConnection);
        }
Пример #2
0
        public virtual bool InvokeCmdletAndVerify(MockClusterConnection givenMockClusterConnection, string givenScript)
        {
            try
            {
                TestUtility.ExecuteScript(givenMockClusterConnection, givenScript);
            }
            catch (CmdletInvocationException actual)
            {
                if (this.testExceptionHelper == null)
                {
                    /// If the exception is not set from MockClusterConnection, passing it upstream to be handled later.
                    throw actual;
                }
                else
                {
                    this.testExceptionHelper.VerifyException(actual);
                }
            }

            return(true);
        }