Пример #1
0
        private Transaction GenerateTransaction(bool extended = false)
        {
            var baseTransaction = new BaseTransaction
            {
                ExecutingEntityCode        = GenerateString(),
                TransactionReferenceNumber = GenerateString()
            };

            if (!extended)
            {
                return new Transaction {
                           BaseTransaction = baseTransaction
                }
            }
            ;

            var extendedTransaction = new ExtendedTransaction
            {
                BaseTransaction = baseTransaction,
                Comments        = GenerateString(),
                Extra           = GenerateString()
            };

            return(new Transaction {
                ExtendedTransaction = extendedTransaction
            });
        }
Пример #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (transactionCase_ == TransactionOneofCase.BaseTransaction)
            {
                hash ^= BaseTransaction.GetHashCode();
            }
            if (transactionCase_ == TransactionOneofCase.ExtendedTransaction)
            {
                hash ^= ExtendedTransaction.GetHashCode();
            }
            hash ^= (int)transactionCase_;
            return(hash);
        }