public void WhenComputerNameDoestNotExistsItThrows()
        {
            // Prepare
            InvokeCompatibilityCheckCmdlet cmdlet = new InvokeCompatibilityCheckCmdlet()
            {
                ComputerName = "non_existent_computer_name"
            };

            // Exercise
            IEnumerator results = cmdlet.Invoke().GetEnumerator();
            PSRemotingTransportException thrownException = Assert.Throws <PSRemotingTransportException>(() => results.MoveNext());

            // Verify
            Assert.Contains("Cannot find the computer", thrownException.Message);
        }
        public void WhenCredentialsAreIncorrectItThrows()
        {
            SecureString secureInvalidPassword    = CreateSecureStringFrom("invalid_password");
            InvokeCompatibilityCheckCmdlet cmdlet = new InvokeCompatibilityCheckCmdlet
            {
                ComputerName = _computerName,
                Credential   = new PSCredential("invalid_username", secureInvalidPassword)
            };


            IEnumerator results = cmdlet.Invoke().GetEnumerator();
            PSRemotingTransportException thrownException = Assert.Throws <PSRemotingTransportException>(() => results.MoveNext());

            // Verify
            Assert.Contains("The user name or password is incorrect.", thrownException.Message);
        }