private void AssertResults(MessagingPollCreationAttachment attachment, GetPollResultReply getPollResult) { var results = getPollResult.Results; AssertEquals(attachment.Options.Count, results.Count, "Results count"); results.Where(r => !r.Result.HasValue).ToList().ForEach(r => AssertEquals(0, r.Weight, "Weight")); }
private void AssetDecimals(MessagingPollCreationAttachment attachment, GetPollResultReply getPollResult) { if (attachment.MinBalanceModel == MinBalanceModel.Asset) { var assetReply = _assetExchangeService.GetAsset(attachment.HoldingId).Result; AssertEquals(assetReply.Decimals, getPollResult.Decimals, "Decimals"); } else if (attachment.MinBalanceModel == MinBalanceModel.Currency) { var currency = _monetarySystemService.GetCurrency(CurrencyLocator.ByCurrencyId(attachment.HoldingId)).Result; AssertEquals(currency.Decimals, getPollResult.Decimals, "Decimals"); } }
private static void AssertHoldingId(MessagingPollCreationAttachment attachment, GetPollResultReply getPollResult) { if (attachment.MinBalanceModel != MinBalanceModel.Nqt && attachment.MinBalanceModel != MinBalanceModel.None) { AssertIsLargerThanZero(getPollResult.HoldingId, "HoldingId"); } else { AssertEquals(0, getPollResult.HoldingId, "HoldingId"); } }