public static void Encode(XdrDataOutputStream stream, SetTrustLineFlagsResult encodedSetTrustLineFlagsResult)
        {
            stream.WriteInt((int)encodedSetTrustLineFlagsResult.Discriminant.InnerValue);
            switch (encodedSetTrustLineFlagsResult.Discriminant.InnerValue)
            {
            case SetTrustLineFlagsResultCode.SetTrustLineFlagsResultCodeEnum.SET_TRUST_LINE_FLAGS_SUCCESS:
                break;

            default:
                break;
            }
        }
        public void TestMalformed()
        {
            var operationResultTr = new XDR.OperationResult.OperationResultTr();

            operationResultTr.Discriminant.InnerValue = XDR.OperationType.OperationTypeEnum.SET_TRUST_LINE_FLAGS;

            var result = new XDR.SetTrustLineFlagsResult();

            result.Discriminant.InnerValue            = XDR.SetTrustLineFlagsResultCode.SetTrustLineFlagsResultCodeEnum.SET_TRUST_LINE_FLAGS_MALFORMED;
            operationResultTr.SetTrustLineFlagsResult = result;

            Util.AssertResultOfType(Util.CreateTransactionResultXDR(operationResultTr), typeof(SetTrustlineFlagsMalformed), false);
        }
        public void TestSuccess()
        {
            var operationResultTr = new XDR.OperationResult.OperationResultTr();

            operationResultTr.Discriminant.InnerValue = XDR.OperationType.OperationTypeEnum.SET_TRUST_LINE_FLAGS;

            var result = new XDR.SetTrustLineFlagsResult();

            result.Discriminant.InnerValue            = XDR.SetTrustLineFlagsResultCode.SetTrustLineFlagsResultCodeEnum.SET_TRUST_LINE_FLAGS_SUCCESS;
            operationResultTr.SetTrustLineFlagsResult = result;

            Util.AssertResultOfType(Util.CreateTransactionResultXDR(operationResultTr), typeof(SetTrustlineFlagsSuccess), true);
        }
        public void TestInvalidState()
        {
            var operationResultTr = new XDR.OperationResult.OperationResultTr();

            operationResultTr.Discriminant.InnerValue = XDR.OperationType.OperationTypeEnum.SET_TRUST_LINE_FLAGS;

            var result = new XDR.SetTrustLineFlagsResult();

            result.Discriminant.InnerValue            = XDR.SetTrustLineFlagsResultCode.SetTrustLineFlagsResultCodeEnum.SET_TRUST_LINE_FLAGS_INVALID_STATE;
            operationResultTr.SetTrustLineFlagsResult = result;

            Util.AssertResultOfType(Util.CreateTransactionResultXDR(operationResultTr), typeof(SetTrustlineFlagsInvalidState), false);
        }
        public static SetTrustLineFlagsResult Decode(XdrDataInputStream stream)
        {
            SetTrustLineFlagsResult     decodedSetTrustLineFlagsResult = new SetTrustLineFlagsResult();
            SetTrustLineFlagsResultCode discriminant = SetTrustLineFlagsResultCode.Decode(stream);

            decodedSetTrustLineFlagsResult.Discriminant = discriminant;
            switch (decodedSetTrustLineFlagsResult.Discriminant.InnerValue)
            {
            case SetTrustLineFlagsResultCode.SetTrustLineFlagsResultCodeEnum.SET_TRUST_LINE_FLAGS_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedSetTrustLineFlagsResult);
        }