Esempio n. 1
0
        public ActionResult ModifyCurrencyWithdrawFeeRate(int currencyID, decimal withdrawFixedFee, decimal withdrawFeeRate)
        {
            var cmd = new ModifyCurrencyWithdrawFeeRate(currencyID, withdrawFixedFee, withdrawFeeRate, this.CurrentUser.UserID);
            this.CommandBus.Send(cmd);

            return Json(JsonResult.Success);
        }
Esempio n. 2
0
        public void TestModifyCurrencyWithdrawFeeRate()
        {
            var userID = new Random().Next(1, 10);
            var currency = GetOneCurrency();
            var withdrawFixedFee = 2M;
            var withdrawFeeRate = 0.002M;

            var cmd = new ModifyCurrencyWithdrawFeeRate(currency.ID, withdrawFixedFee, withdrawFeeRate, userID);

            Assert.DoesNotThrow(() => { this.commandBus.Send(cmd); });

            var savedCurrency = IoC.Resolve<IRepository>().FindById<Currency>(currency.ID);

            Assert.Equal(savedCurrency.WithdrawFixedFee, withdrawFixedFee);
            Assert.Equal(savedCurrency.WithdrawFeeRate, withdrawFeeRate);
        }