コード例 #1
0
        private void CreatePoll(VotingModel votingModel, MinBalanceModel balanceModel, ulong?holdingId)
        {
            var       name               = Utilities.GenerateRandomString(10);
            var       description        = Utilities.GenerateRandomString(30);
            var       finishHeight       = TestSettings.MaxHeight + 1000;
            const int minNumberOfOptions = 1;
            const int maxNumberOfOptions = 1;
            const int minRangeValue      = 0;
            const int maxRangeValue      = 1;
            var       options            = new List <string> {
                "How are you doing?"
            };
            const int minBalance = 1;

            var createPollParameters = new CreatePollParameters(name, description, finishHeight, votingModel,
                                                                minNumberOfOptions, maxNumberOfOptions, minRangeValue, maxRangeValue, options)
            {
                MinBalance      = minBalance,
                MinBalanceModel = balanceModel,
                HoldingId       = holdingId
            };

            var createPollReply = _votingSystemService.CreatePoll(createPollParameters,
                                                                  CreateTransaction.CreateTransactionBySecretPhrase(fee: Amount.CreateAmountFromNxt(10))).Result;

            VerifyCreatePollParameters(createPollParameters, createPollReply.Transaction.Attachment as MessagingPollCreationAttachment);
        }
コード例 #2
0
        private void CreatePollByNqt()
        {
            using (Logger = new TestsessionLogger(_logger))
            {
                const VotingModel     votingModel  = VotingModel.Nqt;
                const MinBalanceModel balanceModel = MinBalanceModel.Nqt;

                CreatePoll(votingModel, balanceModel, null);
            }
        }
コード例 #3
0
        private void CreatePollByAsset()
        {
            using (Logger = new TestsessionLogger(_logger))
            {
                const VotingModel     votingModel  = VotingModel.Asset;
                const MinBalanceModel balanceModel = MinBalanceModel.Asset;
                var assetId = TestSettings.ExistingAssetId;

                CreatePoll(votingModel, balanceModel, assetId);
            }
        }
コード例 #4
0
        private void CreatePollByCurrency()
        {
            using (Logger = new TestsessionLogger(_logger))
            {
                const VotingModel     votingModel  = VotingModel.Account;
                const MinBalanceModel balanceModel = MinBalanceModel.Currency;
                var currencyId = TestSettings.ExistingCurrencyId;

                CreatePoll(votingModel, balanceModel, currencyId);
            }
        }